Graeme Smith then decided he would not enforce the follow-on and at the close his side were 207 for three in their second innings.
Openers Smith and Alviro Peterson (27) raced to 82 before the latter skied an Umar Gul delivery and Mohammed Hafeez completed the catch.
Smith reached his 37th Test 50 before he was caught behind by Sarfraz Ahmed two runs later and Jacques Kallis (7) perished trying to force the scoring rate when he was caught in the deep by Asad Shafiq.
Hashim Amla (50 not out) and AB de Villiers (63 not out) then put on 108 runs to take South Africa to the close.
Steyn dismissed Mohammed Hafeez (six) in his first over of the day as the opener got a faint edge that went straight through to de Villiers, one of a joint South African record of six dismissals in the innings for the keeper.
Debutant Nasir Jamshed (2) was trapped in front by Steyn and, although the batsman challenged the decision, the third umpire upheld the dismissal.
Younus Khan (0) lasted just five balls before he pushed forward to a full Steyn delivery and edged to Smith at first slip to leave Pakistan reeling at 12 for three.
Azhar Ali and captain Misbah-ul-Haq took the score to 36 when Azhar (13) fended a vicious bouncer from Kallis to de Villiers.
Misbah (12) became Kallis’ second victim in controversial circumstances after Billy Bowden gave a caught-behind decision not out and South Africa reviewed. There appeared to be no evidence of a nick on the hot spot replay but third umpire Steve Davis from Australia chose to overturn the decision.
Asad (1) was next to go as he chased a wide delivery from Vernon Philander and succeeded only in edging to de Villiers. Two balls later and a reckless Gul (0) flayed at another wide delivery off the same bowler, Smith pouching the catch.
By lunch Pakistan had stumbled to 40 for seven and just two balls after the interval Saeed Ajmal (1) became Steyn’s fourth victim, this time de Villiers pulling off a wonderful diving catch in front of first slip.
Steyn got his fifth when he induced an edge from Sarfraz (2), before the sorry innings came to a close when Rahat Ali edged to Faf du Plessis in the slips and was out for a duck. Steyn was once again the wicket-taker.
SOUTH AFRICA first innings 253 (J. Kallis 50; Mohammad Hafeez 4-16)
PAKISTAN first innings
M. Hafeez c de Villiers b Steyn 6
N. Jamshed lbw Steyn 2
A. Ali c de Villiers b Kallis 13
Y. Khan c Smith b Steyn 0
Misbah-ul-Haq c de Villiers b Kallis 12
A. Shafiq c de Villiers b Philander 1
S. Ahmed c de Villiers b Steyn 2
U. Gul c de Villiers b Philander 0
S. Ajmal c de Villiers b Steyn 1
J. Khan not out 8
R. Ali c du Plessis b Steyn 0
Extras: (lb-3, w-1) 4
Total: (all out, 29.1 overs) 49
Fall of wickets: 1-9, 2-12, 3-12, 4-36, 5-37, 6-39, 7-39, 8-40, 9-41.
Bowling: Philander 9-5-16-2, Steyn 8.1-6-8-6, Morkel 6-3-11-0 (w-1), Kallis 6-2-11-2.
SOUTH AFRICA second innings
G. Smith c Ahmed b Gul 52
A. Petersen c Hafeez b Gul 27
H. Amla not out 50
J. Kallis c Shafiq b Ajmal 7
A. de Villiers not out 63
Extras: (lb-4, w-1, nb-3) 8
Total: (for three wickets, 53 overs) 207
Fall of wickets: 1-82, 1-87, 3-99.
Bowling: Umar Gul 9-2-25-2 (w-1), Junaid Khan 11-1-41-0 (nb-3), Rahat Ali 11-1-44-0, Hafeez 3-0-15-0, Ajmal 16-1-59-1, Younus Khan 1-1-0-0.