How to decide which university to study for PhD
Choosing a place to do a PhD is a hard task, but one that needs to be completed before you start. I would call your attention to three main points that you need to consider to choose well.

First point is alignment of research interests, methods, and schools of thought. Different research groups have distinct ways of thinking even when looking at the same research topics, therefore, it is important to carefully look whether you fit or not with the research they do, and how they position themselves towards that research. This you can see in the research papers that are published (or not) by them.

Second point is the personality and ways of working of the professors and colleagues. The time you spend in a research group will shape the way you think about and approach research. In some way, you will level your conduct through the examples of the ones around you. For this reason, I would advise you to look for a group that works in an professional, collaborative, open, and ethically sound way (in your opinion). This you can discover by talking with other PhD students and with people that used to be in that institution.

Third point is what you want to do next. If staying in academia is important for you, it would be important that the group publishes in top venues in the area. If going to industry is a path you would prefer, maybe you should look for a place that already has many connections with companies, or that enables you to do some part of your studies while working in a company.

These points are the most important for me.

I do not think that you have to be in a top-5 university to be successful during or after your phd. In the end, it is all up to you. Of course the environment helps, but you will be the one driving your papers and manuscript, so it is up to you. 

Top students will be top everywhere, but it is important that they have people around them that can recognize and foster their talent. Look for someone that understands what you want to do and that trusts you from the beginning to take it to another level.

good luck!