The visitors, who won the first match after scoring a world record 263, rode on opener Glenn Maxwell's 29-ball 66 to chase down their 129-run target with 13 balls to spare.
Earlier Aussie bowlers James Faulkner and Adam Zampa claimed three wickets each to restrict the hosts to 128 for nine despite Dhananjaya de Silva's fighting half-century.
Dilshan, who quit the one-day format in the middle of the five-match series which Sri Lanka lost 1-4, scored just one off three balls in his final international game but took two wickets to add drama to Australia's chase.
However the inventor of the "dilscoop", the cheeky paddle shot played over the wicketkeeper's head, did not have a chance to execute the audacious stroke.
Also Read
"He was my first one-day and Test captain, lucky to captain him in his last game. Thank you Dilshan. My team and I wish you all the best for the future."
"To mention Glenn Maxwell, the way he played in the last game and this game was phenomenal," Australia captain Warner said of his destructive opener who received the man of the match and the series award.
The 27-year-old batsman, who put on a 93-run opening stand with Warner, was bowled by leg-spinner Seekkuge Prasanna after hitting seven fours and four sixes.
Left-arm spinner Sachith Pathirana struck twice in the 10th over of the innings to get Moises Henriques and Warner, who scored 25, trudging back to the pavilion.
Dilshan then trapped Usman Khawaja lbw with his wily off-spin and got the wicket of Matthew Wade, who scored 14, in his very next over as Australia slipped from 93 for no loss to 120 for six.
Travis Head, who remained unbeaten on nine, hit the winning runs to help Australia finish the two-month long tour on a high after the visitors suffered their first series whitewash in the three Tests.
Disclaimer: No Business Standard Journalist was involved in creation of this content