Australian Tomic took two hours and 37 minutes to defeat Anderson 7-6 [7-5] 6-7 [4-7] 6-3 in China.
"I'm happy I won against a player like Kevin because he can beat so many world class players on his day," Tomic said after the match. "I'm happy I won that third set because his serve was too good the whole game.
"To get into tournaments like this, playing main draws is a way to build your ranking up even faster. It's really tough to get there.
"I'm lucky I did it at a young age. I've got a long way to go, and a lot of things ahead of me."
The 18-year-old will now take on number five seed Mardy Fish in the next round.