With his first ball after tea, Tahir had Australian wicketkeeper Brad Haddin trapped lbw and, four balls later, clipped the stumps of Peter Siddle who failed to score.
He also dismissed tail-ender Nathan Lyon to return figures of 3/55.
The leg-spinner made his Test debut at Newlands last week where he bowled 10 overs for 35 runs.
Holding the advantage at lunch, at 169 without loss, the Baggy Greens lost wickets at regular intervals in the afternoon as the South African bowlers looked like a different attack.
Their more aggressive bowling created the pressure which had been missing in the morning session.
Openers Phillip Hughes and Shane Watson were two runs short of the record opening stand at this particular ground, set in 1957/58, when Vernon Philander eventually made the breakthrough.
With the ball moving away from the left-hander, Hughes (88) edged a catch to AB de Villiers at first slip, thus ending the 174-run opening stand.
Watson was also on 88 when he pulled a short ball from Jacques Kallis to Tahir at deep square-leg.
Ricky Ponting's run of bad form continued and he was back in the changeroom for a duck after facing just three balls.
He played across his line to Dale Steyn and missed, and the ball hit his pads plumb in line.
Michael Clarke's poor shot selection gave De Villiers his second catch when the Australian skipper, who made 11, tried to cut a ball from Morne Morkel.
He'd have done better to leave it alone as it flew high to first slip.
Usman Khawaja took nearly two hours to score his 12 runs before Steyn got his second wicket as the new number three for Australia played and missed across his line.
Steyn also saw to the removal of Michael Hussey (20) when the ball clipped his pads before hitting his stumps and it was left to the speedster and Tahir to mop up the tail.
The wickets were shared among the bowlers with Steyn picking up 4/64.
Australia took a 30-run first-innings lead after South Africa were dismissed for 266 on the first day.
South Africa faced four balls in their second innings, without scoring, before bad light stopped play.