He awaits the victor of Saturday's second match between Rafael Nadal and Stefanos Tsitsipas of Greece. I was pretty far from that until now but it's time to improve. But the Swiss lost five straight games to fall behind the 18th-ranked Frenchman who was seeking his second title of the season. "I was really lucky to save the match points".
American Sloane Stephens got past Petra Martic in two sets and will face Kiki Bertens, who upset defending champion Petra Kvitova 6-2, 6-3 in a rematch of last year's final.
Thiem broke Federer for the first time in the third game of the third set, converting his ninth break opportunity of the match.
The world number one put in his best performance since winning the Australian Open to edge through a high class semi-final 7-6 7-6.
Thiem took that momentum on into the deciding set and finally broke Federer in the third game.
In the women's competition, French Open champion Simona Halep is through to the final after fending off a tough challenge from Belinda Bencic. He made a decision to return this year in preparation for his first French Open appearance since 2015.
"This match, regardless if it was win or lose, gave me a lot of information", he said.
"I played with better rhythm and showed some positive things", said Nadal, who missed practice time earlier in the week because of a stomach virus.
The evergreen Federer did not drop a game in a dominant first set but was dragged into an intense battle by an inspired Monfils before prevailing 6-0 4-6 7-6 (3).
They had to be separated by a tie-break and it was a thriller full of drama with the 37-year-old Swiss unable to take advantage of two match points.
He has looked somewhat vulnerable since hammering Nadal to win in Australia, but with two weeks to go before the French Open seems to be zoning in perfectly for the attempt to win a fourth straight Grand Slam.
Also advancing to the quarterfinals were Stefanos Tsitsipas and Stan Wawrinka, who defeated sixth-seeded Kei Nishikori in two sets. Wawrinka will be Nadal's opponent, while Tsitsipas will face Zverev, a three-set victor over Hubert Hurkacz.