Are you referring to a gap year before beginning M1 ... or to a gap year after completing M4?
What types of "publications?"
What types of "research experiences?"
My answer to your questions are contingent on: (1) actual publications (novel content, authorship, impact factor); and (2) actual research experiences (substantive research activities vs. ordinary lab assistant duties, such as cleaning lab equipment).
For instance:
If you publish an original article about internal medicine research in the NEJM, as the principal investigator and sole author in a gap year before beginning M1 ... well, that would probably get a top-tier IM PD's attention later on when you are applying for residencies. Anyway, I think you get the general idea.
For highly competitive specialties (e.g., neurosurg, ortho), it's common for many medical students to obtain meaningful research experiences throughout medical school. This means medical students interested in competitive residencies routinely pursue meaningful research experiences beginning in the summer between M1-M2, and continue to engage in productive research activities thereafter (including a possible gap year after M4).