Cilic, who was also celebrating his 34th birthday, was given a thorough test initially by the wild card, but Thiem ultimately faded away.
After losing the first set, second seed Cilic eventually won 6-7 (6-8) 6-2 6-4 as he succeeded in putting the Austrian's serve under intense pressure, setting up a quarter-final with either fifth seed Botic van de Zandschulp or Liam Broady.
Reacting to the victory, Cilic said: "I think it was a fantastic match. I think it was an amazing, amazing level.
"We don't get so many chances to play [a] second-round [match] in front of this big [of a] crowd, so thank you so much. It was a fantastic birthday."
Maxime Cressy, seeded fourth, was far more comfortable as he defeated fellow American Sebastian Korda 6-4 6-4 thanks to a break of serve in either set.
The only other seed in action was seventh favourite Adrian Mannarino. The Frenchman came unstuck against his countryman Constant Lestienne, who won 7-6 (7-2) 6-4.
At the Sofia Open, two high seeds were surprisingly dumped out on Wednesday.
Home favourite Grigor Dimitrov, seeded third, was beaten in straight sets by Ilya Ivashka, who showed commendable focus to see out a 6-3 7-6 (7-3) win despite the crowd's support of his opponent.
Number six seed Nikoloz Basilashvili was the other big name to suffer a shock defeat, with 38-year-old Fernando Verdasco beating him 7-6 (7-1) 7-5 as the seven-time ATP Tour title winner rolled back the years.
Lorenzo Musetti bucked the trend, however. Seeded fourth, the Italian was made to sweat by Bulgaria's Alexander Lazarov as the first two sets went to tie-breaks, but the Italian had too much in the end as he won 6-7 (5-7) 7-6 (10-8) 6-2.
Earlier in the day, Musetti's compatriot Lorenzo Sonego comfortably dealt with Bernabe Zapata Miralles 6-3 6-4.