Tough question. GT5/6 were the games that stopped me buying Playstations for a generation.
GT7 is technically significantly superior, even when taking into account when the games were released. GT5/6 had a lot of issues.
At the same time, they tried to do a lot of pretty fancy stuff and when it worked it worked. Standard cars were BS, but having 1000+ cars did have it's upsides. The track creators on both games were janky AF, but they were still a nifty thing that got a lot of play. Weather and time cycles were rare in that era. Online was still pretty new to console racing games. And the sheer volume of content went a long way.
I will moan about GT5 and 6 being **** all day, but it's largely because the range in the games were so large. They contained both exceptional experiences that you couldn't find anywhere else and the worst gameplay of any modern sim, all in the same game. There were good times had, but some of the good times were moaning with friends just how broken the games were. I'm not sure I want to go back and play either of them, but they're interesting to remember.
But I don't really feel any drive to play GT7 either. If I'm gonna bother to boot up a racing game, it's not GT7. I feel like there's little point in ranking a bunch of games when you don't want to actually play any of them. If I have a gun to my head I probably try GT5 first, then GT7, and you can just shoot me before I play GT6.
Ultimately, these are three games that all lack a major component that stops them from ever being truly exceptional, or even being particularly good. GT5/6 have technical issues that are far to serious to ever allow them to be called great games. And the gameplay in GT7 is so vanilla and uninspired that even though the game runs and looks lovely it's hard to call it an amazing experience.
The reality is that we all expect a game that feels as good or better than GT4 felt when we bought it in 2005. That shouldn't be a big ask with nearly 20 years more experience making games, and endless new technology to wow us with, but it seems like few people actually got that feeling out of any post-GT4 game.