My answer on Quora:
Thank you for A2A.
Any Gap in training or education makes difference between 2 applicants in residency match.
Gaps which make a big difference in your residency application are ones taken after your medical graduation and during your medical education.
Any medical graduate applying after 3–5 years of graduation without a supporting proof of additional training during these years is at a big disadvantage.
Good supporting proofs for the gap include an additional medical diploma/degree in home country, research, certificate courses. Not good reasons are taking gap for child rearing/pregnancy/marriage/death of relative.
Medical education drops or fails are also taken into notice in your residency application as they speak about your caliber and persistence.
A 4 year gap(as in your case) before entering medical school has very slim chances affecting your residency application . This gap question can likely be asked during your residency interview stage by the Program director so be prepared for a good honest answer.
Hope that helped in clearing your doubt. Let me know if you have any further doubts.