The 35th-ranked Raonic, a victim of various injuries over recent seasons, was playing a final for the first time in his last 16 tournaments dating to Istanbul a year ago. Raonic will face Roger Federer on Sunday in Stuttgart.
Roger Federer will once again return to pinnacle of ATP Rankings on Monday after moving into the final of the Mercedes Cup in Stuttgart.
The 36-year-old will regain the world number one ranking on Monday and is playing next week as top seed in Halle.
"I think I played very well not having played for a while", Federer said as he competed this week for the first time since mid-March after skipping the clay season.
The Swiss came from a set down to beat Nick Kyrgios 6-7, 6-2, 7-6.
A double-fault from the Canadian followed by a return victor from the Swiss set up 3 match points, with Federer needing only his first as Raonic netted a return. "I have nothing to complain about, everything is going positive", he said.
"I had some chances today but couldn't convert them", Raonic said.
Bidding for his 18th grass-court title, Federer was pushed all the way by the fourth-seeded Kyrgios, who had 23 aces.
Kyrgios won their first clash in Madrid back in 2015, 6-7 (2-7), 7-6 (7-5), 7-6 (12-10) but Federer hit back to take the victory in Miami a year ago, 7-6 (9-7), 6-7 (9-11), 7-6 (7-5).
Kyrgios forced a minibreak in the deciding tiebreak, but Federer remained steady and sent a short backhand past his opponent on his first match point to clinch the win 6-7 (2-7) 6-2 7-6 (7-5).
"So I'm very happy with myself and I hope I can continue to improve my level again tomorrow".
Federer has won two tournaments this season and has 97 singles titles overall.
The Swiss star has a 10-3 in career head-to-head meetings against the Canadian.