The Serb, who learned Wednesday that he would be back as world No. 1 next week following Rafa Nadal's withdrawal from the tournament through injury, was leading 6-1, 2-1 when the Bosnian submitted to a back problem that had flared up in the first set.
"Reflecting on what I've been through in the past year, it's quite a phenomenal achievement", said Djokovic after profiting from Damir Dzumhur's retirement in France.
"I always believe in myself, but five months ago, if you'd told me I would be back to number one so quickly, it was highly improbable considering my ranking and the way I played and felt on the court".
World number three Federer will face Italy's Fabio Fognini, the world number 14, who made the next round when Hungary's Marton Fucsovics withdrew injured.
Djokovic will replace Rafael Nadal as the world's top player on Monday after a two-year absence.More news: Houston Texans take wide receiver Demaryius Thomas from Denver
Thiem breezed past Gilles Simon 6-4 6-2 and the in-form Nishikori also won in straight sets against a home favourite, beating Adrian Mannarino 7-5 6-4.
Federer will play either Kevin Anderson or Kei Nishikori in Friday's final eight.
He will play Karen Khachanov after the 22-year-old bested John Isner 6-4 6-7 (9-11) 7-6 (10-8).
The 27-year-old Raonic will next face Roger Federer, who is chasing his 100th career title after winning the Swiss Indoors last week.
Cilic fired 29 winners to advance to the last eight in the French capital for the third straight year.More news: OnePlus 6T launched: Here are the specifications and price in India
Cilic, who has beaten Djokovic just twice in 17 meetings, ended reigning ATP Finals champion Dimitrov's season.
Djokovic, who is looking to win his 33rd ATP World Tour Masters 1000 crown this week in the French capital, will return to the summit of men's professional tennis on Monday nearly two years to the day since he completed his 223rd and most recent week in top spot.
"I am very close to London, to securing my spot mathematically", Cilic said. "It's great to play him again".
Defending champion Jack Sock did not face a break point and needed less than one hour to beat lucky loser Malek Jaziri 6-0, 6-4.
"In the next match against Novak it will be another big challenge".More news: Joel Embiid kept shouting ‘you can’t guard me’ at Andre Drummond
There was a more stressful passage for Isner, but the American did just enough to edge out Mikhail Kukushkin 6-3 6-7 (2-7) 7-6 (7-1) and keep his hopes of an ATP Finals place alive.