South Africa fought back after half-centuries by Yasir Hameed and Younis Khan had put Pakistan on top on the first day of the first Test on Thursday.
Pakistan, who won the toss and chose to bat, were 242 for five when bad light ended play six overs early. Captain Inzamam-ul-Haq was 35 not out with Kamran Akmal on 18.
Hameed scored 65 while Younis scored 68. They shared a partnership of 133 for the third wicket after Pakistan had slipped to 50 for two in the second hour of play.
They were dismissed three overs apart after tea. Younis top-edged a pull off medium-pacer Shaun Pollock and was caught by Andre Nel at fine leg then Hameed's pull shot off fast bowler Nel was caught by Makhaya Ntini at deep square-leg.
Seven overs later fast bowler Jacques Kallis had Faisal Iqbal caught behind by wicketkeeper Mark Boucher for one.
The catch was Boucher's 367th in Test matches, which put him ahead of Australian Ian Healy for the most catches in Test cricket. Healy still holds the record for the most dismissals with 395, 13 more than Boucher.
Boucher also became the fourth South African after Pollock, Kallis and Gary Kirsten to earn his 100th Test cap on Thursday.
South Africa's first successes came shortly after the first drinks break when fast bowler Ntini, who took two for 52, removed openers Imran Farhat and Mohammad Hafeez in consecutive overs.
The openers put on 48 together before Farhat cut uppishly and was caught by Hashim Amla at point for 26.
In Ntini's next over Hafeez, who scored 19, gloved a catch to Boucher.
That was in the fourth over before lunch and Hameed and Khan held the advantage for Pakistan until they were separated in the sixth over after tea.
Fast bowler Dale Steyn, who suffered a recurrence of a thigh strain in the third Test against India in Cape Town, was replaced by Nel in the only change to the South African team.
Scorecard
Pakistan (1st innings):
Mohammad Hafeez c Boucher b Ntini 19
Imran Farhat c Amla b Ntini 26
Yasir Hameed c Ntini b Nel 65
Younis Khan c Nel b Pollock 68
Inzamam-ul-Haq not out 35
Faisal Iqbal c Boucher b Kallis 1
Kamran Akmal not out 18
Extras: (lb-6, nb-3, w-1) 10
Total: (for five wickets, 84 overs) 242
Fall of wickets: 1-48, 2-50, 3-183, 4-193, 5-204.
To bat: Shahid Nazir, Naved-ul-Hasan, Danish Kaneria, Mohammad Asif.
Bowling: Ntini 18-2-52-2, Nel 20-3-66-1, Pollock 18-5-38-1, Kallis 15-3-55-1 (nb-3 w-1), Harris 13-2-25-0.
South Africa: G.Smith, A.de Villiers, H.Amla, J.Kallis, H. Gibbs, A.Prince, M.Boucher, S.Pollock, P.Harris, A.Nel, M.Ntini.