Set 151 for victory, Pakistan were 112 for four needing 39 from 32 balls for the win before Imran Tahir bowled Shoaib Malik (15) and Abdul Razzaq (0) in successive balls.
Wayne Parnell then had innings top-scorer Sohaib Maqsood (37) caught by wicketkeeper Quinton de Kock at the start of the next over to rock the sub-continent side.
They never quite recovered and as the run-rate slowed, South Africa were able to turn the screw. The key wicket of Shahid Afridi (14) with eight balls remaining sealed Pakistan's fate and they ended their 20 overs on 144 for nine.
Parnell finished with three for 25 in his four overs and was ably supported by Dale Steyn (two for 20) and Tahir (two for 21).
South Africa, who claimed the two-match series 2-0, had earlier won the toss and elected to bat with their top three doing the damage.
Captain Faf du Plessis top scored with a fine 58 not out from 48 balls that included three sixes, while Hashim Amla rediscovered his form with 48 from 41 balls.
Exciting young opener De Kock hit six fours in his 30 from 19 balls as the Proteas posted 150 for five in their 20 overs.
Saeed Ajmal was again the pick of the Pakistan bowlers with three for 25 in his four overs, while Sohail Tanvir collected two for 21 in his four.
The sides now travel to South Africa for a two-game T20 and three-match one-day international series starting on Wednesday.Teams:
Pakistan: Ahmed Shehzad, Nasir Jamshed, Mohammad Hafeez (capt), Sohaib Maqsood, Shoaib Malik, Umar Akmal (wk), Abdul Razzaq, Shahid Afridi, Sohail Tanvir, Saeed Ajmal, Mohammad Irfan
South Africa: HM Amla, Q de Kock (wk), F du Plessis (capt), H Davids, AB de Villiers, DA Miller, R McLaren, WD Parnell, DW Steyn, LL Tsotsobe, Imran Tahir