
Raonic, who earlier spoke of his grief over a high school shooting in his home country, eliminated the Swiss world number four 6-4, 6-3, 5-7, 4-6, 6-3 and will face Gael Monfils in the quarters.
The 13th seed, who beat Wawrinka's fellow Swiss Roger Federer to win this month's Brisbane International, remains unbeaten this year after his impressive victory in three hours 44 minutes.
It was Raonic's first win against the reigning French Open champion in five meetings, and he has not lost a match at tour level since going down to Rafael Nadal in the third round of last year's Shanghai Masters.
Raonic, looking to take his game to another level under new coach Carlos Moya, was on track for a straight-sets win after four service breaks to lead by two sets in 76 minutes.
But Wawrinka lifted his intensity and took the match to a fifth set.
"It is more about what always comes down to me, trying to play in my rhythm, dictate and control the centre of the court and I thought like I was able to carry that through today," Raonic said.
"It's the next step for me to try and achieve the goals I want to achieve and I am always looking at ways to get better and I am always working for that." ?AFP