How is Kakashi close in age to Nagato?
Minato died at the age of 24. If he were to survive, he would have been 36 in Part 1, and 39 in Part 2.

In Part 2, Nagato's age is confirmed to be 35, in the databooks.

This means there's a 4 year age difference between Minato and Nagato, where Minato is elder.

Kakashi's age was about 29-31 in Part 2, confirming that he's younger than Nagato by 4-6 years.