I’m going to speak for France because it’s the one I know. 5 years is the time you can start sending your application, and then it takes some time for them to review it, invite you for an interview, and decide whether naturalization can be granted.
So it’s not just those 5 years (during which you pay taxes, you usually need at least three years of tax receipts to be considered for citizenship), but also the time during which you wait for a decision.
I’d say you need at least 6 years. You also should use that time to learn French to at least B1 level.
they also require a long time of service, or you could get injured in combat and become French through ‘blood shed’