And in Friday night's other match, Perth Glory scored a 96th-minute penalty to snatch a 1-1 draw on enemy territory against Western Sydney.
City took the lead just 27 seconds into their match at Coopers Stadium courtesy of Mariana Speckmaier's early strike.
But the league leaders were left stunned in the eighth minute when a harmless-looking back pass to Barbieri sneaked under her boot and rolled in for an embarrassing goal.
Barbieri, a former Matildas captain who was making her first appearance of the season, couldn't believe her error, with City teammates quickly rushing across to console her.
The 44-year-old was breathing a huge sigh of relief when her team retook the lead in the 41st minute via Chelsie Dawber.
And McNamara sealed all three points in the 74th minute when she made a fast break and chipped the goalkeeper, just three minutes after coming off the bench.
McNamara hadn't scored since rupturing her ACL when completing a hat-trick against Newcastle in November, 2023.
She made her return in last week's 4-2 win over Canberra, and the joy was written all over her face on Friday when she scored the sealer against Adelaide.
HOLLY MAC IS BACK! 🙌🩵— Ninja A-League (@aleaguewomen) Matildas star Holly McNamara scores her first goal after a 13 month injury lay-off. What a moment 🥹📺 Watch #ADLvMCY live NOW on Paramount+ / 10 Play pic.twitter.com/ezc0NKsePjDecember 20, 2024
Melbourne City now have five wins and two draws to their name from seven matches, while Adelaide (three wins, four losses) have slipped out of the top four with back-to-back defeats.
City made a hot start, with Speckmaier rounding an opponent and unleashing a curling strike to open the scoring after just 27 seconds.
Barbieri was keen to make an impression in her first match of the season but stood out for the wrong reason in a blooper for the ages.
The veteran keeper made the mistake of momentarily taking her eye off the ball when she stuck out her left boot to trap teammate Rebekah Stott's regulation back pass.
HOW DID SHE SCORE FROM THERE?! 👀— Ninja A-League (@aleaguewomen) Tyla-Jay Vlajnic restores @MelbourneCity's lead with an incredible strike from outside the box 🔥 What a hit. 📺 Watch #ADLvMCY live NOW on Paramount+ / 10 Play pic.twitter.com/sQM2ZK0qyvDecember 20, 2024
After the ball rolled under her foot, Barbieri's frantic attempt to race back and stop it it going into the goal proved fruitless.
But it mattered not.
Dawber's attempted cross soon before half-time floated over Adelaide's goalkeeper and in for a goal.
And McNamara's introduction in the 71st minute brought instant rewards, with the Matildas striker needing only a matter of minutes before scoring City's third goal.
In Friday's match at Wanderers Football Park, Amy Harrison's 85th-minute free kick gave Western Sydney a 1-0 lead before Glory hit back late in dramatic fashion.
Wanderers goalkeeper Sham Khamis pulled off two sharp saves to deny Kelli Brown and Gabby Hollar from close range in the dying minutes.
But Khamis undid her good work when she clattered into Glory substitute Miku Sunaga and gave away a penalty.
Brown stepped up to the spot and powered her penalty into the top corner, with the ball rocketing in despite Khamis getting a glove to it.Â
Even though Glory at least escaped with a point, they ended the match with 25 shots to 11 and would be disappointed not to have scored more goals.