Top 5, but it depends on your goals. If you are interested in academic medicine and research then top 5 for sure. Are you interested in primary care? I would choose the In-state in that case. Since you want a competitive residency, the top 5 will help you achieve this but a top 50 medical school can also allow you to achieve this. You will just need to perform a little better to make up for the name-brand. If you are talking about something like plastic surgery, then top 5 definitely.
Where are you planning to practice medicine, in-state or some other region of the country? If you are staying within your region, rank probably doesn't matter. since you are taking loans, count the interest over 7-10 years.