New Zealand were 137 for two, chasing 401 for victory. Captain Ross Taylor was on 48 and his deputy, Brendon McCullum, 58. With 98 overs scheduled had play started on time, New Zealand were needing less than three runs an over for what would have been a remarkable vicgtory.
South Africa had declared their second innings at 435 for five, with centuries from captain Graeme Smith, Jacques Kallis and Jacques Rudolph.
New Zealand's highest successful fourth innings run chase was 324 for five at Christchurch in 1994 against Pakistan.
History would suggest the 401 runs South Africa set New Zealand to win in its fourth innings will be too many.
Then again, McCullum and Taylor made a sizable dent in the target, batting superbly to see the home side through to 137 for two at stumps on day four at the University Oval in Dunedin.
If play gets underway today, the Black Caps will resume needing a further 264 runs to seal an unlikely win.
New Zealand's largest successful run chase in the fourth innings was 324 for five against Pakistan in Christchurch in February 1994.
Earlier, Jacques Rudolph posted his sixth test century - his second against New Zealand - to help cement South Africa's dominant position. The visitors declared at 435 for five having resumed at 268 for three.
The declaration has left New Zealand half a chance, particularly with the way McCullum and Taylor have approached their innings to date.
The pair looked in majestic form. McCullum (58) raced to 50 from 65 deliveries, and Taylor (48) belted some fabulous cut shots.
''We are confident. We are playing the best team, if not the best team then the second best team in test cricket in the world at the moment, and we are going into day five of a test match and we have a chance of winning it.''
South Africa resumed with Rudolph on 13 and Jacques Kallis undefeated 107. Kallis could not build on his marvelous innings, falling for 113. But Rudolph, who was saved by the Umpire Decision Review System late on day three, got himself set at the crease before lifting the tempo after the lunch break.
Tim Southee, who has the unfortunate match figures of none for 140, came in for some punishment and Rudolph brought up his 100 with a nice sweep shot off Daniel Vettori.
New Zealand had an early setback with Martin Guptill (6) nicking out to a ripper from Vernon Philander.
Rob Nicol battled hard for 90min only to throw his wicket away to a full toss from Imran Tahir.