Berrettini, a 2019 US Open semi-finalist, came through 7-6 (11/9), 7-5, 6-3 to send the 81st-ranked South African veteran packing in round one.
Big-serving Anderson has never beaten a top-10 player at the Australian Open but he troubled Berrettini, who needed to save eight set points in the opening set to keep his tournament on track.
The second and third sets were equally tough with Berrettini finally getting the decisive break in game nine of the third before serving out for the match.
“It was really tough, but I knew he is a great player and server, so I was ready,” said the Italian. “Luckily I was able to serve well as well.”
Now 34, Anderson has slid down the rankings since his heyday, when was runner-up to Rafael Nadal at the 2017 US Open and was the Wimbledon runner-up in 2018, losing to Novak Djokovic.
Berrettini came into the tournament on the back of wins against world number three Dominic Thiem, 11th-ranked Gael Monfils and Spain’s Roberto Bautista Agut at the ATP Cup, before losing to the in-form Daniil Medvedev.
He next faces qualifier Tomas Machac.
Asked what he knew about the Czech, Berrettini replied: “Nothing.”
Meanwhile, South Africa’s other hopeful in the singles draw, Lloyd Harris, won his opening round match against Denmark’s Mikael Torpegaard 4-6, 6-3, 6-2, 6-2.
Harris next plays Australian wildcard Alexei Popyrin, who upset 13th seeded Belgian David Goffin 3-6, 6-4, 6-7 (4/7), 7-6 (8/6), 6-3.