The tourists were level on the final ball of the innings after Ashton Tye had limited them to five runs from the first five deliveries, but Chamara Kapugedera's boundary sealed the victory for Sri Lanka in dramatic fashion.
Australia batted first and set Sri Lanka a target of 169 to win, with captain Aaron Finch passing 1,000 T20I runs on his way to 43 - the hosts' highest individual score.
That contributed to an opening partnership of 76 with Michael Klinger, who became Australia's oldest T20 debutant at the age of 36, while Travis Head (31) also made a decent start to his innings before being dismissed by the returning Lasith Malinga.
Malinga then took the wicket of Ashton Turner straight afterwards to leave him on a hat-trick, but he failed to mark his first full international for almost a year in spectacular fashion.
Sri Lanka's run-chase got off to a shaky start when captain Upul Tharanga was dismissed for a duck, but Niroshan Dickwella (30), Dilshan Munaweera (44) and Asela Gunaratne (52) put the tourists in command.
Two quickfire wickets from Turner set up the dramatic finale, but Sri Lanka held their nerve to claim the victory.