The captain hit six boundaries and a six in his knock of 85 off 81 balls, and Dinesh Chandimal brought up an assured 80 at Bellerive Oval in Hobart, as the tourists overhauled Australia's 280 for six with four balls and three wickets to spare.
"It was one of those days when most of your shots went to the gaps," Jayawardene said.
Sri Lanka now lead the Tri-series with 15 points, one more than Australia, ahead of the finals which start on March 4.
"The youngsters are learning a lot from these games," Jayawardene said. "We are top of the table but we still need to do a lot of hard work."
Sri Lanka's hopes of victory looked dim when Angelo Mathews miscued a delivery from Dan Christian (3-53) with 14 runs required from nine balls. But Thisara Perera hit a four and a six off the next two balls, and Nuwan Kulasekara hit a four in the last over to seal the victory.
"Unfortunately, we couldn't get over the line, but full credit to Sri Lanka," said Michael Clarke, the Australia captain. "Our execution with the ball wasn't good and the top four could do better."
The Sri Lanka opener Tillekeratne Dilshan made just three before he was caught by Peter Forrest at deep square-leg off Ben Hilfenhaus in the eighth over.
Kumar Sangakkara edged a Christian ball to David Warner for 22, and Jayawardene was stumped by the wicketkeeper Matthew Wade when he was beaten by a Xavier Doherty delivery.
Lahiru Thirimanne added 24 before becoming Christian's second victim, caught by Hilfenhaus.
Chandimal hit seven fours in his knock. He was trapped lbw by Ryan Harris. Farveez Maharoof had added just five when he lofted a ball to Harris off Hilfenhaus.
Forrest had scored 104 for his first international century in what appeared to be a challenging Australian total. His century was the first of the Tri-series tournament, which also involves India.
Clarke made a quick-fire 72 off 79 balls in a 152-run, third-wicket stand with Forrest to steady Australia after an early collapse.
Australia made a poor start when the opener Matthew Wade was caught by Jayawardene at wide mid-off for five in just the second over. Warner, his opening partner, was caught behind for seven while defending a Maharoof delivery.
Perera claimed an athletic catch on the mid-wicket boundary to give Mathews (2-43) the valuable wicket of Clarke.
Forrest had hit 10 boundaries and two sixes when he offered a simple catch to Maharoof off a slower Mathews ball.
Michael Hussey made 21 off 14 balls before being bowled by Lasith Malinga and Christian was stumped by Sangakkara after he charged up the wicket at a Rangana Herath delivery.
David Hussey was unbeaten on 40 with Brett Lee on 20 at the end of the Australia innings.