Sri Lanka, who chose to bat first, rode on half-centuries from skipper Angelo Mathews, Kusal Mendis and Kusal Perera to put up a respectable score in 48.5 overs against a persistent bowling attack.
The hosts lost two wickets in two balls after paceman Mitchell Starc struck early to send opener Danushka Gunathilaka trudging back to the pavilion.
Off-spinner Nathan Lyon, who shared the new ball with Starc, then bowled the veteran Tillakaratne Dilshan for 10 to have the hosts in trouble at 12 for two.
Mendis, who followed up his 67 in the first ODI with a run-a-ball 69, hit nine boundaries and forced Australian skipper Steve Smith to use seven bowlers until the 21st over.
More From This Section
The pair put quick runs on the board before a triple strike by leg-spinner Adam Zampa checked the hosts' surge.
Chandimal, who top-scored with an unbeaten 80 in the previous game, was denied his sixth consecutive ODI fifty after Zampa trapped him lbw for 48.
Zampa, 24, struck again in his very next over to get another lbw shout in his favour, but this time danger man Mendis was plumb in front of the wicket.
The leggie also accounted for Dhananjaya de Silva to leave Sri Lanka struggling on 158 for five but the hosts were rescued by another crucial partnership between Mathews, who scored 57, and Kusal Perera who made 54.
Their 103-run sixth-wicket stand entertained a raucous home crowd as they smashed the bowlers to all parts of the ground.
But Faulkner hit Sri Lanka hard after getting Kusal Perera with the last delivery of his eighth over. He came back to dismiss Mathews and Thisara Perera to complete his hat-trick.
Starc (3-53) claimed two wickets in the final over to stop Sri Lanka from reaching the 300-run mark, with the hosts losing their last five wickets for 27 runs.
Sri Lanka are trailing the five-match ODI series 1-0.