The world No.1 overcame a slow start, which looked set at one stage to condemn him to a swift defeat, to drag himself back into the contest.
However, Thiem proved too strong as he clinched a 6-2, 3-6, 6-4 win in two hours and 15 minutes.
A day after needing a final-set tie-break to see off Albert Ramos-Vinolas in just shy of three hours, the Scot again endured another gruelling work-out.
He was outclassed in the first set, but dug in during the second as he grew into the contest and levelled the match with a single break of serve.
He was a break up and then down by one in the third as both players proved near impossible to shake off, but fourth seed Thiem prevailed to claim his third British scalp of the week after knocking out Kyle Edmund and Dan Evans.
This was Thiem’s first win over Murray in three attempts, but both of their previous two contests had gone to three sets and this was another scrap.
Murray started badly as he was broken in the first game of the match, gifting Thiem the advantage with a tame forehand into the net.
The Scot struggled to get into his stride as he dropped his serve three times in the set, Thiem ruthlessly converting three out of three break points, to his opponent’s one.
The Austrian’s fierce hitting was proving too much for Murray, playing his second tournament after his elbow injury and clearly still getting back up to speed.
The Scot faced a real battle to hold serve in the first game of the second set, but did so as it went with serve, albeit Thiem’s holds were far more routine than his opponent’s.
The momentum swung in the eighth game of the set, though, as Murray broke decisively for a 5-3 lead before seeing it out to level at 1-1.
Murray broke again at the start of the third set, his fourth game on the trot, but Thiem stopped the rot by breaking straight back. Murray faced break points at 3-2 down in the decider and Thiem duly moved 4-2 in front.
But the Scot had 0-30 and 15-40 in the next game and made the most of the chance to break straight back.
Murray served to stay in the match at 4-5, but, when he went way long with a smash to hand Thiem a match point, the 23-year-old closed out the contest.
“He’s the No.1 in the world, so you have to find something in between playing aggressive and not making mistakes,” Thiem said. “I was the luckiest in the end.”
Murray said: “In the first set, I didn’t have many chances, but I started to play better in the second. It was quite windy out there and difficult to get into a rhythm. He started to hit the ball pretty hard and was pushing me back.
“When the conditions are like that, it’s important to be the one dictating the points. I started to do a better job of that, but in that last game I missed a couple of shots I shouldn’t have.”
Aljaz Bedene secured a place in the final of the Hungarian Open with a straight-sets win over Serbian Laslo Djere. The British No.4 forced two early breaks to take charge of the opening set before going on to close out a 6-2, 6-4 victory in one hour and 19 minutes. He faces Frenchman Lucas Pouille in the final.
The win was a 16th in succession for Bedene, who had secured back-to-back titles on the second-tier Challenger Tour before coming through qualifying in Budapest and going on to upset second seed Ivo Karlovic in the quarter-finals.
Bedene was ranked outside the top 100 at the start of March, but his run sees the Slovenian-born 27-year-old closing in on a return to the top 50.