hmm I have to wonder, When were the first three shinobi wars in relation to the other events. We know that kakashi gaiden was near or at the end of the third war, but where would you put the other two?
though if you believe the anime, Jiraiya taught the rain trio during the third war. Of course I feel it was probably at the end of the second war.
The anime screwed up again. The manga timeline is pretty clear that the Sanin encountered the Rain trio near the end of the Second ninja war (their youth makes it obvious too, they were in their mid teens- early twenties during the Second war, thirties during the Third. It's not explicitly stated but it's a good guess the First war was winding down around the time Tobirama sacrificed himself and Hiruzen became Hokage- likely a year or so before Hiruzen became the Sanin's Genin teacher, so when the Sanin were around 4-5 years old.
Here's a bit of the timeline I've worked out:
Hashirama and Tobirama died during the First ninja war
Nawaki died during the Second Ninja war (probably around the beginning of that war, and it ended around the time the Sanin were in their early 20's)
Dan's death- happened when tensions were starting to ramp up building toward the start of the Third war. (It's not directly referenced as happening during the Third war so it's probably shortly before it started, when the Sanin were in their late 20's- Dan was 27 when he died, and it's most likely Tsunade was about the same age as him- it fits the chronology. Sakumo was most likely around the same age as the Sanin too, as it would fit the usual age range for becoming a parent- the Sanin are 24 years older than Kakashi)
Sakumo- killed himself during the early years of the Third war, when Kakashi was 7 years old- making Sakumo 31, interestingly- Kakashi was 30 when he died briefly and met his father again. We don't know when Kakashi's mother died but it was some years before Sakumo did)
Yahiko and Obito died near the end of the Third War
Dream you dream alone is only a dream, but dream we dream together is reality- Yoko Ono 1971
When you go to war, both sides lose totally- Yoko Ono
Remember, our hearts are one. Even when we are at war with each other, our hearts are always beating in unison- Yoko Ono 2009