Okay:
So to start, I think it would fair to say Naruto started his "formal" training at the age of 6. Generally that's around the age when kids join the Shinobi Academy. Naruto doesn't Graduate till he is 12. From there he does various missions and trains under Jaraiya. From there 3 years pass for the Time Skip and then by the time we get to Boruto where Naruto is around 32. Kakashi was Hokage for I believe around 10 years and then Naruto becomes Hokage. Now given Naruto is Hokage and is under a heavy workload, I wouldn't say he's gotten weaker but I think it would be fair to say he isn't training as regularly or taking on as much field work. Overall I would say Naruto has a total training/field work time of 20 to 25 years. I think that's fair.
Now Luffy is a bit more complicated. We know Garp left him with Dadan when he was around 7, at that time he'd already met Shanks, had his Devil Fruit, and his scar. But we know for a fact that Garp had been trying to train Luffy prior to that. I think it's fair to say Garp started Luffy's training when he was no long a toddler which is generally around the age of 4. So from that point to the time he Left Foosha Village was 13 years and then the time skip happened which was 2 years. So Luffy currently has around 15 years of "informal" training/field work under his belt.
So I will agree Naruto has 5 to 10 years of training/field work on Luffy. However Luffy has defeated somebody who also has 5 to 10 years of training/field work on him, Rob Lucci. I don't believe we have a specific age that Lucci began his training under the Marines however we can say with some level of certainty it was between the ages of 4 and 6. He would go onto join CP9 at age 13 and then he would go onto become the Marines most deadly and skilled assassin and infiltrator in the public facing side of the Marines. By the time he fights Luffy at Enies Lobby he is 28 which means he has between 22 and 24 years of "formal" training/field work under his belt.
So there you go, Luffy with 15 years of "informal" training/field work was able to beat somebody with 22 to 24 years of "formal" training/fieldwork which is about as much Naruto has which is the amount of fighting expirience that Naruto used to defeat His various Otsutsuki opponents.
Also, as a quick aside, it's pretty consistent that the Otsutsuki rely on their overwhelming power and hax-based abilities to beat people because literally every single time we see the power gap between them and their opponents equalized, they get the breaks beat off of them in hand-to-hand combat. It happened with Momoshiki, Kinshiki, Urashiki, and Isshiki.