The 37-year-old Swiss beat his compatriot 7-6 (7/4), 4-6, 7-6 (7/5), 6-4 to reach his 43rd major semi-final and eighth at Roland Garros.
He trails his head-to-head record with Nadal 23-15, but has won their last five meetings.
Defending champion Rafael Nadal, bidding for a 12th title at the French Open, blitzed a weary Kei Nishikori 6-1, 6-1, 6-3 in his quarter-final.
“It was hard, really, really hard. Stan played a really good match, I'm very happy to play him here at Roland Garros,” said Federer.
The 20-time Grand Slam champion is the oldest man to make the semis at one of the big four tournaments since Jimmy Connors at the 1991 US Open aged 39.
Wawrinka saved 16 of 18 break points in a thrilling encounter, but Federer quickly finished off the match after a rain delay to progress.
It is the third seed's first appearance at the French Open since 2015 after taking time away from clay to focus on Wimbledon, but he has been in fine form in Paris and has only lost one set so far — as has Nadal.
Nadal, who turned 33 on Monday, is three behind Federer in the all-time list of Grand Slam singles titles heading into their 39th career clash.
It will be Federer's first Roland Garros semi-final since a defeat by Novak Djokovic in 2012.