In an encounter lasting almost two-and-a-half hours, the veteran Australian emerged a 6-7 (6-8) 6-3 6-4 winner over the big-serving American.
The 32-year-old Hewitt will face 18th-seeded Swiss Stanislas Wawrinka for a place in the round of 16. Wawrinka defeated American Wayne Odesnik 3-6 6-2 6-1.
Hewitt, ranked 98th in the world, won the Kooyong Classic exhibition tournament in the build-up to the Australian Open in January, but he hadn't previously put together back-to-back wins on the ATP Tour this year.
In a triumphant day for Australia, Samantha Stosur also won through to the third round.
The seventh-seeded Australian, who enjoyed a first-round bye, beat young American Madison Keys 6-3 6-4.
Stosur set up a third-round clash with China's No.32 seed Peng Shuai, who downed Alexandra Dulgheru of Romania 6-0 4-6 6-3.
Fourth-seeded German Angelique Kerber defeated another Romanian Irina-Camelia Begu 6-3 6-2, and Jamie Hampton of the US accounted for 20th seed Su-Wei Hsieh of Taiwan 6-3 6-3.
No.30 seed Yanina Wickmayer of Belgium eliminated Croatian Mirjana Lucic-Baroni 3-6 6-3 6-2, while Germany's Julia Goerges (21) was too strong for Swede Sofia Arvidsson with a 6-3 6-3 victory.
In the men's draw, 37th-ranked South African Anderson, who had right elbow surgery in January, stunned fourth-seeded Spaniard David Ferrer 3-6 6-4 6-3.
It marked the first time since Cincinnati last August that Ferrer fell in his first match of a tournament, not including his retirement during the first set at Shanghai in October.
The Spaniard, 30, had claimed two titles in five tournaments this year. He also reached the final at Acapulco, where he was comprehensively beaten 6-0 6-2 by Rafael Nadal in the former world No.1's third tournament back from a seven-month injury layoff.
Anderson claimed the third victory over a top-five player of his career. He had lost his past 11 encounters against players ranked in the top 10.
In the third round, Anderson will face Jarkko Nieminen. The 31-year-old Finn ranked 57 in the world upset another seeded Spaniard, 29th-ranked Fernando Verdasco, 6-1 6-0.
Benoit Paire of France beat German 21st seed Philipp Kohlschreiber 6-4 6-2, and Leonardo Mayer of Argentina knocked out Russian 30th seed Mikhail Youzhny 6-2 6-3.