Pakistan shrugged off the loss of captain Sarfraz Ahmed to suspension as left-arm fast bowler Usman Shinwari took four wickets in six balls and South Africa were dismissed for 164 in the fourth one-day international on Sunday.
Ahmed is returning immediately to Pakistan after being suspended for four games by the ICC for making racist remarks about the Proteas´ Andile Phehlukwayo during last week´s ODI in Durban.
It gave the visitors an outstanding chance of squaring the five-match series with one match to play.
Stand-in skipper Shoaib Malik handled his bowlers and fielders astutely and South Africa were kept under pressure almost from the time Malik won the toss and sent them in onto a Wanderers Stadium pitch which had early life.
Shaheen Shah Afridi made two early strikes before Hashim Amla (59) and captain Faf du Plessis (57) made half-centuries and put on 101 for the third wicket.
But Malik´s use of spinners Imad Wasim and Shadab Khan kept the scoring rate in check and both batsmen fell to the slow men before the fast bowlers returned.
Mohammad Amir dismissed the dangerous David Miller before Shinwari had Rassie van der Dussen caught behind for 18 and bowled Dale Steyn for a two-ball duck.
Kagiso Rabada was caught behind first ball and Beuran Hendricks survived an appeal for leg before wicket with what Shinwari hoped was the hat-trick ball. The ball was crashing into the stumps but Shinwari acknowledged that umpire Bongani Jele had made the right decision because there was a faint inside edge.
Shinwari had Phehlukwayo caught at slip off the first ball of his next over before Shadab Khan had last batsman Imran Tahir caught in the deep.
South Africa were defending a perfect 7-0 record on what has become known as ´Pink Day´ with their players and many spectators dressed in pink in aid of breast cancer awareness.