The 1992 champions were frustrated by two rain delays after being put into bat by the Proteas and stuttered to 222 all out in 46.4 overs, skipper Misbah-ul-Haq (56 off 86 balls) top scoring.
But South Africa made hard work of chasing a revised target of 232 in 47 overs and, despite fireworks from AB de Villiers (77 from 58), they were dismissed for 202.
Sarfraz Ahmed was handed his first start of the tournament for Pakistan and swiftly made a run-a-ball-49, despite losing opening partner Ahmed Shehzad (18) to a brilliant diving catch from Dale Steyn.
Sarfraz, who crunched JP Duminy???s spin for three sixes in one over, put on 62 for the second wicket with recalled veteran Younis Khan, before running himself out in pursuit of his fifty.
Younus??? departure with the score on 132 ??? the 37-year-old snaffled by part-time seamer De Villiers ??? led to a mini-collapse for Pakistan, who sunk to 175-5 before the first rain delay as Sohaib Maqsood (8) and Umark Akmal (13) fell cheaply.
Shahid Afridi smoked two maximums in a dashing 15-ball 22 once play resumed, moving past 8,000 ODI runs in the process, but Pakistan, irritated by another 18-minute interlude, lost their final five wickets for 10 runs.
Misbah’s fourth half-century of the tournament prevented Pakistan from folding earlier, with the 40-year-old becoming the first batsman to score 5,000 ODI runs without collecting a century.
Misbah was eventually dismissed by Dale Steyn, the Proteas quick the pick of his side???s attack after also taking the wickets of Afridi and Rahat Ali to end with figures of 3-30 from his 10 overs.
Pakistan seamer Mohammad Irfan, however, took just two deliveries to strike in South Africa???s reply, the seven-footer forcing Quinton de Kock (0) to edge a gem of a delivery through to wicketkeeper Sarfraz.
Hashim Amla (38) and Faf du Plessis (27) came out swinging and combined for a second-wicket stand of 67, Amla thumping nine boundaries in an enterprising 27-ball innings.
However, when both batsman nicked behind to Sarfraz with 67 on the board and then Rilee Roussow (6) and David Miller (0) were sent packing shortly after, South Africa were languishing at 77-5.
De Villiers, who drilled seven fours and five sixes, was given brief support from Duminy (12 from 13), Steyn (16 from 17) and Kyle Abbott (12 from 19) but when he feathered Sohail Khan to Sarfraz after coming dancing down the pitch with 32 still needed, the Proteas??? hopes extinguished.
And when last man Imran Tahir (0) became the sixth batsman to find Sarfraz???s gloves, Pakistan secured the victory that moved them level on six points with South Africa in Pool B.