The South African, a Wimbledon finalist last year, struggled with an elbow injury early in the clash and couldn’t cope with Tiafoe’s power and finesse.
World number 39 Tiafoe, who is into the third round at Melbourne Park for the first time, equalling his best ever Grand Slam result, next plays veteran Italian Andreas Seppi.
“It means the world to me,” said the American, who will celebrate his 21st birthday on Sunday and is fresh from playing the mixed teams Hopman Cup in Perth with Serena Williams.
“I lost to him three times last year and when I was down a set and a break it looked like it would happen again. I dug deep and went to a different place.
“It’s all about competing, how bad you want it and I want it real bad. I’d love to get to the second week of a Slam for the first time,” he added.
Anderson warmed up for the Australian Open by winning his sixth ATP title at Pune earlier this month, defeating Croat veteran Ivo Karlovic in the final.
He had been looking for a deep run at Melbourne Park this year after getting past the opening round for the first time since 2015.