It will be 28-year-old Djokovic's 27th consecutive appearance in the quarter-final of a grand slam tournament.
"Playing against a player like Gilles you can expect a lot of rallies," said Djokovic. "He is always making you play an extra shot. I made a lot of unforced errors but he was fighting and was playing well.
"Physically it was very demanding and I'm just happy to get through this one."
It was a bad day for the French contingent. Ninth seed Jo-Wilfried Tsonga slumped out in straight sets to Kei Nishikori. He will next play Djokovic.
Four-time champion Roger Federer swept past Belgium's David Goffin.
The 24-year old idolised Federer while growing up famously revealing a few years back at the French Open in Paris that he had posters of the Swiss maestro on his bedroom wall.
The 15th seed played as if he was still asleep as Federer raced into a 6-2 6-1 advantage in less than an hour. There was more fight from Goffin in the third set but he eventually succumbed 6-4.
"I'm pleased with how I played," said Federer. "David normally gives me a hard time in practice so I was surprised at how well I went."
Federer, 34, seeking his 18th grand slam crown, will play Tomas Berdych in the quarter-final.
The Czech sixth seed came through in five sets against the Spaniard Roberto Bautista Agut.