The unseeded Khachanov broke Thiem to lead 5-4 and served out the first set.
The players swapped breaks at the start of the second set before Khachanov reeled off the next five games, clinching victory on his first match point when the sixth-seeded Thiem chopped a shot wide.
Khachanov won the Kremlin Cup in Moscow last month for his third career title. Although he is 3-0 in finals, he has never played in a Masters final before.
They play later Saturday — their 47th career meeting — with Djokovic leading his longtime rival 24-22 overall and having won the past three encounters.