Paceman Umar Gul led Pakistan's revival with a three quick wickets as South Africa were restricted to 365-9 at lunch on the second day of the first Test on Saturday.
Gul claimed three scalps in 20 balls to help Pakistan take six wickets for 54 runs in the morning session when it seemed South Africa were set to post a big first-innings total on a seemingly flat Dubai Stadium pitch.
Pakistan, who had to pull out experienced batsman Mohammad Yousuf minutes before the toss on Friday, also lost paceman Wahab Riaz because of a side strain which will prevent him from bowling in the innings.
Gul (3-92) led the attack admirably and was well supported by spinners Abdul Rehman (3-101) and Saeed Ajmal (1-88). Ajmal dismissed a well-set Jacques Kallis, caught behind by debutant wicket-keeper Adnan Akmal for 73.
Akmal was called up to replace Zulqarnain Haider who left the team on Monday and announced his retirement from international cricket, amid fears for his safety.
Day one saw South Africa dominate the Pakistani attack. Graeme Smith notched his 22nd hundred while Hashim Amla (80) and Alviro Petersen (67) put South Africa in command.
But the morning session on day two belonged to Pakistan. Resuming at 311-3, South Africa lost Paul Harris for a duck in the sixth over of the day when the nightwatchman edged Gul to the slips where Younis Khan held onto a difficult catch.
Gul then had AB de Villiers (five) bowled with a sharp incoming delivery and in his next over trapped Ashwell Prince leg-before for one, leaving South Africa on 329-6.
Rehman trapped Mark Boucher (nine) leg-before and bowled Johan Botha (10) to further derail the South African innings.