Inzamam made an unbeaten 92 as Pakistan took a first innings lead of 141. Then Asif, opening the bowling in the absence of the injured Shoaib Akhtar, dismissed both opening batsmen as South Africa reached 115 for three in their second innings, still 26 behind.
Inzamam's heroics overshadowed South African fast bowler Makhaya Ntinis 300th Test wicket, with Pakistan adding 99 runs after Ntini reached the milestone by dismissing Mohammad Sami, who was the seventh man out.
Ntini said though that it had been "a marvellous day" even though Pakistan had finished so strongly.
"Inzy played quite a big role. It was one of those days that fitted him," said Ntini.
There was a setback for Pakistan, however, when Shoaib did not take the field at the start of the South African innings.
Shoaib, who was earlier seen in television pictures in an apparent verbal altercation with Pakistan coach Bob Woolmer, went for a scan on a left hamstring injury.
Ntini refused to speculate on how many runs South Africa would seek to score but indicated he expected the remaining batsman to do well.
"The wicket is an absolute belter," he said.
"Once you get in, there is nothing the bowler can do."
Inzamam batted at number eight after being off the field for much of South Africas dismal first innings of 124 after being hit in the left shoulder by a ball during fielding practice before the start of play Friday.
The Pakistan captain came out to bat at the start of play Saturday with his team tottering at 135 for six.
Sami helped him add 31 for the seventh wicket and Inzamam skillfully farmed the strike to the frustration of the South African bowlers.
Inzamam was at his best in a last wicket stand of 74 with Asif, the best partnership of the match, with Asif having to face only nine balls out of 61 before lunch as Inzamam seemed easily to be able to score off the fifth or sixth balls of overs.
Asif eventually faced 29 balls out of 122, the last of which uprooted his off stump as Ntini finished with six for 59.
Ntini, 29, earlier had Sami caught behind off an inside edge to become the 21st bowler in Tests and the third South African to reach the 300 mark.
He unveiled a tee-shirt which proclaimed, 'Mdingi Express 300' with the nickname coming from the Eastern Cape village in which he was born. It completed Ntinis 17th five-wicket haul in Tests.
Inzamam was fortunate to survive an appeal for a catch behind off Andre Nel when he was on 13 in the over after Samis dismissal.
The ball went through to wicketkeeper Mark Boucher off Inzamams pad and umpire Peter Parker gave him not out. But slow motion replays showed that he got an inside edge to the ball before it brushed his pad.
Inzamam was dropped on 35. An attempted hook shot against Jacques Kallis ballooned off his glove but Boucher, leaping high to his left, could only get the tip of his left glove to the ball.
Pakistans ninth wicket fell at 191 when Inzamam was on 31 and he added another 61 runs before the last wicket fell.
Asif struck in the ninth over of South Africas second innings when Smith edged a low chance to first slip where Inzamam held a diving catch to his left. Then he bowled AB de Villiers with an in-swinger.
Sami bowled Hashim Amla and South Africa were in deep trouble at 61 for three before Jacques Kallis (50 not out) and Ashwell Prince (21 not out) took them through to the close with an unbeaten partnership of 54.
Prince had an escape on 17 when Kamran Akmal missed a stumping chance off leg-spinner Danish Kaneria.