David Bedingham scored his maiden Test century as South Africa handed New Zealand a victory target of 267 on a tricky pitch on the third day of the second and final Test at Hamilton's Seddon Park on Thursday.
Bedingham's 110, mostly scored in a 98-run partnership with Keegan Petersen for the fifth wicket, drove the inexperienced Proteas to 235 all out to give them a fighting chance of levelling up the series at 1-1.
New Zealand openers chipped 40 runs off the target in the last hour but Devon Conway was dismissed lbw for 17 by spinner Dane Piedt in the final over of the day.
Conway's fellow opener Tom Latham will resume on 21 not out on Friday as the Black Caps look for the 227 runs they need to secure a first series win over South Africa in 72 years of trying.
Debutant paceman Will O'Rourke, the only New Zealander with less experience than most of the South Africans, took five for 34 as the last six Proteas wickets fell for 33 runs but the day belonged to Bedingham.
"Obviously really cool," said the 29-year-old. "I hope this innings can win us this Test and draw the series. (Getting) Conway probably puts us even but I think (our bowlers) have it in them to get nine more wickets."
Bedingham made his Test debut in the two-match series against India over New Year but was one of only two players to back up in New Zealand as Cricket South Africa preferred to keep the cream of their talent at home for the SA20 tournament.
Thrashed by 281 runs in the first Test last week, South Africa had bowled brilliantly on Wednesday to take a first-innings lead of 31 runs but New Zealand had them wobbling on 88-3 at lunch.
All-rounder Rachin Ravindra ensured that Clyde Fortuin's miserable series with the bat continued, while O'Rourke got the rewards for some fine bowling with the wickets of Raynard van Tonder and skipper Neil Brand (34).
Veteran South African-born seamer Neil Wagner finally got his chance with the ball after the break and made an immediate impact with a trademark short ball which Zubayr Hamza (17) only succeeded in pulling to Will Young at deep square leg.
Bedingham and Petersen, the other South African who had faced India, then set about putting together the sort of partnership that New Zealand had looked for in vain on Wednesday to put the Proteas back in charge, reaching tea at 186/4.
Petersen departed for 43 to a brilliant diving catch from Glenn Phillips off the bowling of Matt Henry but Bedingham would not be denied a classy century, reaching the milestone with two runs from the 127th ball he faced.
Phillips then took over, removing Ruan de Swardt and Piedt cheaply with his right-arm spin and taking another fine catch at gully to finally send Bedingham back and give O'Rourke his fourth victim.
O'Rourke completed the skittling of the tail when he had Dane Paterson caught behind to secure his maiden Test five-wicket haul and take his match tally to 9/93.
"Real special day," said O'Rourke. "I think we're feeling pretty confident. Obviously they batted well through the middle and we had to grind away but it fell pretty quickly in the end."