Danushka Gunathilaka put up a brilliant performance at the top of the order with a half-century.
Gunathilaka put on a 63-run partnership with Sadeera Samarawickrama, who scored 32.
Faheem Ashraf wrapped up the Sri Lanka innings after three run-outs with a hat-trick, the first by a Pakistani bowler in T20Is.
Hasan Ali finished with figures of 2 for 31 in four overs as Sri Lanka were reduced to 124 for 9 in 20 overs.
Thisara Perera, the Sri Lanka captain, stepped to the fore and returned with figures of 3 for 24 in order to stymie the Pakistan batting.
Despite a few scares in the middle, Sarfraz Ahmed led the chase admirably with a score of 28 to seal yet another series win for Pakistan by two wickets.