Amir Ali and Naseem Shah took four wickets a piece for 44 and 52, respectively, as the hosts were bowled out for 253 in 43.3 overs. Johathan Bird scored run a ball 75 with 10 fours and two sixes.
Ruan Terblanche (53) and Bryce Parsons (39) were the other notable run-getters.
Earlier, after electing to bat, the tourists scored 341 for eight in 50 overs. Rohail Nazir top-scored with a 91-ball 89 and hit 11 fours while Mohammad Haris contributed a quick-fire 62 off 41 balls that included eight boundaries and a six.
Haider Ali (59) and Fahad Munir (56) contributed 65 runs for the second wicket.
For the home side, Imraan Philander was the pick of the bowler with three wickets for 52 runs.
The fifth match of the series will be played on 2 July at the same venue.