The 26-year-old, who defeated Federer at Wimbledon this summer, claimed his second win this season over the Swiss player with 7-6 (7/3), 4-6, 6-1.
"I really played good tonight, I was opportunistic," said Tsonga. "I didn't miss any opportunities I had. I was able to break before he did. I'm very happy the way I won this match.
"I'm happy now to be in the quarter-finals. It was a tough draw to have Federer in the Round of 16. I'm going to rest and hope to play a good match tomorrow."
"I believe that no player can be spared," Tsonga added. "Look at Rafa who lost, and Murray. The only one remaining above everybody else is Djokovic. But during the past weeks, the tournaments are much more open."
The Frenchman is due to play Nicolas Almagro in the quarter-finals of the Rogers Cup.