New Zealand were 34 for six at lunch on Tuesday, still needing another 215 to win.
Makhaya Ntini started the collapse when he took two wickets in his second over. He had figures of four for 19, while new ball partner Dale Steyn took two for 13.
New Zealand's collapse was worse than in the first innings when they were 45 for five but recovered to make 327 and take a first innings lead.
First innings century-maker Jacob Oram was among Ntini's victims, bowled for two by a fast delivery which kept low and sent his off stump flying.
On an overcast, cool morning, Ntini had Peter Fulton caught behind off the first ball of his second over.
First innings tail-ender Kyle Mills was promoted to number three but two balls later was caught by a diving Boeta Dippenaar at first slip.
Steyn had New Zealand captain Stephen Fleming caught at second slip and Scott Styris caught behind before Ntini had Nathan Astle caught at third slip.
Then Oram was bowled to leave New Zealand's innings in tatters.
Opening batsman Hamish Marshall survived the carnage and was on 12 not out but he took a heavy blow in the ribs from a lifting ball from Ntini and was struck on the left glove off the next ball.
The pitch again gave the bowlers plenty of help, with uneven bounce accentuated by the new ball.
Earlier it took New Zealand 29 minutes and 7.1 overs to capture the last South African wicket, with Steyn and Ntini adding 19 runs to South Africa's overnight total of 280 for nine before left-arm spinner Daniel Vettori trapped Ntini leg before for 16 with his first ball of the day.