Michael Clarke top-scored with 57 in Australia's modest total of 231, before claiming the scalp of Dinesh Chandimal (37) at an important time to help dismiss Sri Lanka for 226 in 49.5 overs.
Spinner Xavier Doherty also played a key role, snaring 2-24 from 10 overs to put the breaks on Sri Lanka's run chase in front of 13,085 fans.
All-rounder Dan Christian, who scored 33 with the bat, was also important with two wickets.
Australia, who opted against handing Peter Forrest his debut, will be aiming to make it three wins on the trot when they take on India (1-1) at Adelaide Oval on Sunday.
Sri Lanka were cruising at 1-61 in the 15th over before paceman Clint McKay produced a brilliant piece of fielding to run out Kumar Sangakkara for 22.
After playing McKay to short square leg, Sangakkara slipped mid-pitch after being sent back by batting partner Tillakaratne Dilshan.
That was all the time needed by McKay, who scooped up the ball and threw down the stumps in the one motion to find Sangakkara well short of his crease.
Sangakkara sent a fierce glare Dilshan's way as he trudged off the field, and Dilshan didn't last much longer before edging Ryan Harris through to the keeper for 40.
And when Clarke trapped Chandimal in front to reduce Sri Lanka to 6-129 in the 31st over, the looked over - only for Mathews to inspire a remarkable fightback.
Earlier, Australia's top order failed in the 40-degree heat after Sri Lanka won the toss and surprisingly elected to bowl.
Matthew Wade and Ricky Ponting were dismissed for one, while David Warner looked good before being bowled for 34.
Clarke, who plundered 626 runs at an average of 125.20 during the recent Test series win over India, combined with Christian to lift Australia from a precarious 5-130 to 5-186.
But their dismissal within four runs of each other - followed soon after by the demise of Harris - left Australia in all sorts of trouble at 8-192, before tail-enders McKay (25) and Starc (14) added handy runs.
AAP