The world number 1 was on the back foot in the opening two sets as the Italian teenager delivered a performance for the ages.
The Serbian struck 31 winners to beat Cuevas in straight sets and will play Lithuania's Ricardas Berankis next in Paris.
The Serbian breezed past the Spaniard to reach his 15th quarterfinal at the Internazionali BNL d'Italia.
Alexander Zverev won the Madrid Masters for the second time as he defeated Matteo Berrettini in three sets.
Matteo Berrettini had earlier won the Belgrade Open and he will be aiming to win the Madrid Masters against Alexander Zverev.
Fresh from beating Rafael Nadal in the quarterfinals, the German sailed into his second final in the Madrid Open with little to no difficulty.