Hashim Amla hit a sparkling 92 but Pakistan took five South African wickets before tea on the first day of the third and final Test at SuperSport Park here on Friday.
South Africa were 201 for five at tea.
Rahat Ali and Ehsan Adil, neither of whom had taken a wicket in Test cricket before, were responsible for all five dismissals.
The left-armed Rahat, playing in his second Test, took three for 57, while new cap Adil, 19, took two for 39.
Amla looked set for his 20th Test century before edging a drive against a wide delivery from Rahat to be caught behind by wicketkeeper Sarfraz Ahmed.
He struck 13 fours in a 128-ball innings and shared partnerships of 69 for the third wicket with Faf du Plessis (29) and 79 for the fourth wicket with AB de Villiers, who was unbeaten on 40 at tea.
With Mohammad Irfan playing in his second Test, the three Pakistan pace bowlers went into the match with two caps between them.
Junaid Khan, who was impressive in the first Test, had not recovered from a thigh injury while the experienced Umar Gul's five wickets in the first two Tests had come at a cost of 46.80 runs each.
Although they produced wicket-taking deliveries, both Rahat and Adil were inconsistent and sent down enough loose deliveries for South Africa to maintain a scoring rate of close to four runs an over.
South Africa were without star all-rounder Jacques Kallis because of a calf strain suffered in an optional practice on Thursday.
He was replaced by fast-medium bowler Kyle Abbott, 25, who earned his first cap after being called into the squad as cover earlier in the week.
Abbott topped the wicket-takers in the domestic first-class competition, taking 49 wickets for the Dolphins at an average of 15.36.
South Africa, who have already clinched the series by winning the first two Tests, had one other injury-enforced change, with Rory Kleinveldt replacing fellow fast bowler Morne Morkel.
Pakistan made three changes, with Imran Farhat replacing opening batsman Nasir Jamshed, while Rahat and Adil came in for Umar Gul and Tanvir Ahmed.