Sri Lanka nervously chased a modest 233-run target with Dinesh Chandimal hitting an unbeaten 64 as Sri Lanka won in 49.4 overs at Sheikh Zayed Stadium.
For Pakistan, Misbah-ul Haq top-scored with 51 while Mohammad Hafeez and Anwar Ali scored 41 each.
Sri Lankan paceman Lasith Malinga took 4-57.
Pakistan won the first, third and fourth matches while Sri Lanka won the second match.
The two teams will now play three Tests, the first starting in Abu Dhabi from Tuesday.