His impressive teammate Dusan Lajovic, buoyed by a huge contingent of Serbian fans at Ken Rosewall Arena, earlier crushed world number 21 Felix Auger-Aliassime 6-4, 6-2.
"This was the closest match I have ever played against Denis. It was so close it could have gone a different way easily," said Djokovic.
"He was playing some terrific tennis and I want to give a huge round of applause and credit to him. Well done."
The win sets up a semi-final against Russia, whose two singles players - world number five Daniil Medvedev and the 17th ranked Karen Khachanov - are unbeaten this season.
The other last four clash will see the Nick Kyrgios-led Australia play either Belgium or Rafael Nadal's Davis Cup-winning Spain, who are on court later Friday.