The players battled a tight encounter in the first set, but the South African managed to produce quality in the key moments to secure the break, which allowed him to take the set 6-3.
The second proved to be just as hard-fought as the first as neither player gave away anything on their serve, forcing a tie-breaker. However, Anderson found his form and blasted his way to a 7-3 victory to take a 2-0 lead in the match.
Neither player could force a break in the third set, although the South African did have a match point, but Thiem kept him at bay to take the set the distance for a second time. However, the number 15 seed once again upped the ante in the tie-breaker and powered a forehand winner to clinch the match.
Anderson will play either Andy Murray in the last 16 of the competition.