By top journals in medicine I refer to JAMA, NEJM, Lancet, BMJ, etc. I recently read a question here asking how to become a peer reviewer and it left me wondering about it.
I personally would not ever expect it (but not say no if invited). Basically, I do not consider that to be a reflection that I do good research and publications. That is something I still strive for, even if no such invitations.
I have been invited to serve as peer reviewer several times over the years. In each case the invitation was based on my having published research in the past that was related to the article being reviewed. My advice is to continue publishing in high-level journals. Editors search for potential reviewers based on the degree to which the reviewers have already demonstrated expertise in the specific research area.