Wawrinka, ranked number nine in the world, lost the first two sets to seventh-ranked Gasquet before recovering to win in five sets.
The 6-7 (5-7),4-6, 6-4, 7-5, 8-6 victory means the 28-year-old Lausanne native will meet defending French Open champion Rafael Nadal on Wednesday.
Nadal celebrated his 27th birthday on Monday by beating Japan’s Kei Nishikori 6-4, 6-1, 6-3.
The Spaniard is aiming to win his eighth French Open title and will pose a difficult challenge for Wawrinka, who earlier this month lost to Nadal in the final of the Madrid Masters.
Federer, reaching the 36th Grand Slam quarter-finals in his career, is set to take on France’s Jo-Wilfried Tsonga on Tuesday.
Meanwhile, world number one Novak Djokovic also made it into the quarter-finals after a slow start against Philipp Kohlschreiber.
The 26-year-old Serb lost the first set against the German before rebounding to win the next three sets.
Djokovic will next play another German, Tommy Haas, 35, who became the oldest player to reach the quarter-finals at Roland Garros in more than 40 years.