Djokovic, who is guaranteed to take the No. 1 ranking on Monday, struggled on his serve for much of the first set.
Cilic had chances to break him in the fifth and seventh games and finally did so in the ninth after Djokovic hit a backhand long.
An ace gave Cilic set point, and he took it when Djokovic sent a backhand wide.
Djokovic broke for 3-1 in the second set and did not look back.
In the third set, a Cilic crosscourt forehand winner saw him break the Wimbledon and U.S. Open champion for 2-1.
Djokovic broke his racket in frustration and then broke Cilic right back, after which the momentum shifted back in his favor, as Cilic lost to him for the 16th time in 18 meetings.
The Austrian served out the match and clinched victory on his first match point when Sock hit a big forehand long.
“I’m in the semifinals of a Masters 1000 only for the fourth time,” Thiem said. “It means a lot for me because I didn’t do too well in the previous years in this part of the season. So it’s something really special to reach the semifinals.”
Thiem broke the American in the fifth game of the third set, then showed good composure to save two break points of his own at 15-40 in the eighth game.
“We always have to be aware of getting broken here. Somehow a lot of breaks are happening,” Thiem said. “It’s a little bit comfortable to return here.”
The sixth-seeded Thiem, meanwhile, next faces unseeded Karen Khachanov of Russia in their first career meeting.
Khachanov, who won the Kremlin Cup in Moscow last month, broke fourth-seeded Alexander Zverev‘s serve six times in a 6-1, 6-2 win.
Zverev had treatment on his right shoulder late in the first set and made a string of unforced errors. He took exception to some comments made in Khachanov’s box and spoke to his opponent at the end of the first set.
“I told him my shoulder is hurting and that his uncle, or something, that he’s going a bit crazy,” Zverev said. “I told him to tell him to keep it down a little bit because he was going a little bit too much over the edge.”
Zverev said he was struggling all week with his troublesome right shoulder.