Thiem earned 14 break points but could convert just one of those as 28-year-old Djokovic registered a 6-3 6-4 win.
“It was far from easy, he has some of the biggest firepower from the back of the court,” said Djokovic.
The world number one will play Tomas Berdych – a winner over Richard Gasquet – in the last eight on Wednesday.
Theim, 22, led the ATP Tour alongside Djokovic on 24 wins this year heading into the match.
He pushed hard to recover a break when Djokovic served for the first set, and thought he had done so with a backhand down the line before Hawkeye ruled in the Serb’s favour.
Djokovic held on to take the set but needed two breaks and all his defensive ability to keep the Austrian at bay in the second, eventually winning in one hour and 49 minutes.
Czech Berdych earlier beat France’s Gasquet 6-4 3-6 7-5, while Australian Nick Kyrgios made his first Masters 1000 quarter-final with a 7-6 (7-3) 6-3 win over American Tim Smyczek and will next face Canada’s Milos Raonic.
In the women’s draw, Swiss ninth seed Timea Bacsinszky upset Romanian fifth seed Simona Halep 4-6 6-3 6-2.