Resuming on 135-6, they began slowly but added useful runs when the nightwatchman Sami hit two boundaries in a Nel over.
But Makhaya Ntini nipped none back and caught the inside edge, recording the hostile paceman's 300th Test wicket.
Short balls accounted for Shoaib Akhtar and Danish Kaneria but Inzamam-ul-Haq survived to make his 46th Test fifty.
Earlier, Pakistan, who were already 11 runs ahead of South Africa's mediocre 124 going into the second day at Port Elizabeth, looked set for a commanding advantage when Inzamam and Sami took their partnership to 31 from 49 balls.
But Ntini's pace and the agility of keeper Mark Boucher signalled the landmark wicket, with the paceman becoming the 22nd man to reach the 300 wicket stage, and the third South African.
The Pakistan tailenders were clearly uncomfortable against the short ball and this was not lost on the experienced South African bowlers, with venerable all-rounders Jaques Kallis and Shaun Pollock soon brought into the attack.
Shoaib, after fending off some brutal deliveries awkwardly, finally succumbed to Kallis, while Danish Kaneria could only glove Pollock tamely to the gully.
Kallis even employed the short ball to the kingpin himself, Inzamam, and might have dismissed the captain when he was on 35 and the score 195-9.
Inzamam, trying to take as much of the strike as possible, saw the need to find more runs and hooked at the fifth ball of the over.
He could only glove a quick delivery down the leg-side but Boucher could not cling on to the chance one-handed at full stretch to his left.
The skipper continued to farm the strike masterfully, with last man Mohammad Asif subjected to only seven balls in the 10.1 overs he was at the crease.
South Africa Ist innings 124 Vs Pakistan 223 for 9 (Inzy 62 n o, Younis Khan 45, Akmal 33; Ntini 5 for 41, Pollock 2 for 42)