Sri Lanka had earlier posted a competitive total built in part on Rathnayake, whose half-century brought him to 427 runs in the tri-series at an average of 106.75, complemented by two centuries against England and a healthy strike rate.
Pakistan's tournament campaign also featured strong performances from Minhas, who decimated England with a six-wicket haul at the start of the tri-series.
The target remained well within reach as Pakistan's younger players maintained their composure after previous dismissals left work to be done in the match.
Shaheen brought his side back into contention by limiting Sri Lanka's scoring momentum, stopping the batting side from going stratospheric.
Pakistan secured a tri-series final victory against Sri Lanka following a successful run chase, despite having been bowled out for 110 by the same opponents four days earlier.
Baig advanced to his first international half-century off 52 balls, reaching the milestone hours before his 20th birthday while clattering the ball alongside his teammates.
Rathnayake has had a cracking couple of weeks, and his half-century took him to 427 runs in the tri-series at 106.75, two tons against England to go with a healthy strike rate.
Both clattered the ball at a similar rate, and Baig, hours before his 20th birthday, advanced to his first international half-century off 52 balls.
The game was even and boundaries were disappearing for more than 10 overs, the drought only broken when Minhas thumped Shanaka through the covers.
This was a target well within reach, even for a batting lineup bowled out for 110 by Sri Lanka four days earlier.