The Swiss second seed was beaten 7-6(5) 7-5 and Djokovic later saw off Britain’s Andy Murray 7-5 6-2 to advance to the semi-finals of a tournament he won last year.
Federer had narrowed the points gap on Djokovic in recent weeks but defeat in Bercy halted his charge, while Japan’s Kei Nishikori and Raonic completed the line-up for the season-ending ATP World Tour Finals which will be played in London from Nov. 9-16.
All is not lost for Federer, however, as the Swiss is able to boost his points tally in the Davis Cup final against France.
“Milos played well. As I said, I always thought it was going to get solved in London,” Federer, who beat Raonic in the Wimbledon semi-final this year, told a news conference.
“Whether I am number one at the end of this year or one or two weeks later next year, it doesn’t really matter. Novak seems to be fit, anyway.”
Seventh seed Raonic, who qualified for London after Nishikori beat Spanish fourth seed Ferrer 3-6 7-6 (5) 6-4 to become the first Asian singles player to qualify for the season-ending showpiece, served 21 aces to beat Federer for the first time in seven attempts.
Raonic will face Tomas Berdych in the semi-finals after the Czech booked his place in London with a 6-7(4) 6-4 6-4 victory over South African Kevin Anderson.
Djokovic, who edged a close first set against Murray before running through the second, will take on sixth seed Nishikori.
Federer appeared relieved that he would have a little more time to prepare for the Tour Finals.
“What this does is I will have a good preparation for London,” he said. “It’s not that I didn’t want to win here, but I knew it was going to be tough from the start. I accept that.”
The 17-times grand slam champion never found the key on Raonic’s huge serve and managed to engineer only one break point, in the 10th game of the second set when the Canadian bombed down an ace to fend off a set point.
A superb backhand pass in the next game allowed Raonic to break the Federer serve and he closed out the match in style.
“Considering all the circumstances around it, I think this was the biggest win for me,” Raonic told reporters.
Fifth-seeded Berdych, who won on his Bercy debut in 2005, became the sixth player to secure his place in London.
After losing the opening set tiebreak, he found his range on serve to level and recovered from a break down in the third set to finally subdue Anderson and qualify for the year-ender for the fifth year in succession.
THE RACE TO LONDON: POINTS
1 Novak Djokovic 9370 – qualified
2 Roger Federer 8700 – qualified
3 Rafa Nadal* 6835 – withdrew
4 Stan Wawrinka 4895 – qualified
5 Kei Nishikori 4625 – qualified
6 Andy Murray 4475 – qualified
6 Tomas Berdych 4465 – qualified
8 Milos Raonic 4200 – qualified
9 Marin Cilic** 4150 – qualified
* Nadal has withdrawn due to appendicitis
** Cilic qualifies as U.S. Open champion. (Reuters)