World number eight Thiem defeated the German qualifier 7-5 6-3, breaking in the final game of the first set to steer clear of a potentially troublesome tie-break.
The Austrian had to dig in to defend three break points early in the second before pouncing in game four, fighting from 15-40 down to serve out the match and set up a meeting with either Robin Haase or David Ferrer.
Marterer had given his home fans plenty to shout about, though, playing his part in an epic rally in which he scrambled across court and slipped as he returned a slice from Thiem before getting back to his feet and playing a shot with his back to the net.
A hotly contested clash saw Gasquet come from behind to defeat Monfils 3-6 6-4 6-3. Gasquet hit 22 aces and saved 12 of 15 break points to keep his opponent at bay.
Dustin Brown wasted five match points in the second set of his clash with Vasek Pospisil but managed to seal a 6-1 6-7 (3-7) 7-6 (7-4) victory.
Wildcard Andrey Rublev shocked eighth seed Albert Ramos-Vinolas 6-7 (1-7) 7-5 6-4, while 2011 champion Philipp Kohlschreiber beat Joao Sousa 3-6 6-4 6-4