The world number 66, formerly an ATP rankings leader, slugged out a 6-3 6-3 4-6 6-7 (7-9) 7-6 (10-6) success against 13th seed Berrettini, who reached the semi-finals last year.
It handed Berrettini a first opening-round exit at a grand slam since the 2019 Australian Open.
Murray said he “wouldn’t expect to feel perfect” for his next match on Thursday, given the effort that went in over the four hours and 49 minutes on Rod Laver Arena.
However, the 35-year-old, who will face Fabio Fognini or Thanasi Kokkinakis next, will want to be back to somewhere near full health for that tussle.
Last year in Australia, Murray beat 21st seed Nikoloz Basilashvili in another gruelling first-round five-set marathon, before losing tamely to Japanese qualifier Taro Daniel in his second match.
In all, Tuesday’s scalp of Berrettini gave Murray his fourth five-set win at the Australian Open. The other two came in semi-finals, beating Roger Federer in 2013 and Milos Raonic three years later. He lost in the subsequent final both times to Novak Djokovic.
Djokovic has beaten Murray in four Australian Open finals, with the Briton also sunk by Roger Federer in the 2010 title match, meaning he has been runner-up five times and never come away with the trophy.
Federer has won the most men’s singles matches in Australia, with 102 victories, landing six titles along the way. Djokovic, with nine, has the most titles.
A weary Murray said after finishing off Berrettini: “In the last few years, I’ve certainly questioned myself at times. There’s certainly a lot of people who have questioned me and my ability, whether I could still perform at the biggest events and the biggest matches.
“I felt very proud of myself after the match. That’s not something that I generally felt over the years at the end of the tennis matches.
“I was impressed with myself, which again is not something… I’m hard on myself usually.”