David Bedingham scored 110 for the Proteas, who were bowled out for 235 in their second innings of the second Test against New Zealand in Hamilton on Thursday.
South Africa had been 202-4, before the dismissal of Keegan Petersen (43) triggered a collapse.
Debutant Black Caps seamer Will O’Rourke took 5-34, to take his tally for the match to nine.
Needing 267 runs to win the match and claim their first Test series win against South Africa, New Zealand were 40-1 at stumps, still 227 short of their target.
Tom Latham was 21* while Devon Conway was trapped lbw by Dane Piedt for 17 in the day’s final over.
The highest successful fourth-innings chase by any team at Seddon Park was 212, achieved by Australia against New Zealand 24 years ago.
HIGHLIGHTS: New Zealand vs Proteas (2nd Test, Day 3)
Bedingham’s maiden Test century was comfortably the standout knock in South Africa’s second innings on day three.
With his team 31-runs ahead on the first innings, he batted aggressively in difficult batting conditions.
The 29-year-old scored 12 fours and two sixes in a 141-ball stay that backed up his 87 from the first Test in Mount Maunganui, which South Africa lost by 281 runs.
Bedingham and Petersen combined for a crucial fifth-wicket stand of 98 before Petersen’s dismissal sparked a collapse, with the last six wickets falling for 33 runs.
Twenty-two-year-old O’Rourke had too much pace and bounce for the tailenders.
Earlier, he removed Raynard van Tonder for one and then Brand in quick succession to have South Africa in trouble at 39-3.
Glenn Phillips, who claimed two wickets with his part-time off-spin, pulled off three catches in the gully, two of them spectacular.
Phillips’ easiest catch was to remove Bedingham off an O’Rourke delivery that climbed steeply.
Bedingham was able to capitalise on New Zealand’s failure to include a specialist spinner on a pitch that is favouring slow bowlers, scoring freely off Phillips and Rachin Ravindra.
New Zealand’s biggest threat in their run chase shapes as off-spinner Piedt, who took five wickets in the first innings.
Photo: Hannah Peters/Getty Images