The tourists were 145 for two at the close of play on day four still needing 172 to win and set a new record for a successful run chase on foreign soil.
The much maligned top order found some form to put together two solid partnerships on a wicket the has lost some of its zip and is keeping low at times.
Openers Jamie How and Aaron Redmond set the tone with a 55-run stand for the first wicket at the Divisional Stadium and the stoic Redmond found another committed ally in Jesse Ryder to add 90 for the second wicket.
At the close the dogged Redmond, playing in his fourth test match, was unbeaten on 62 and nightwatchman Daniel Vettori was yet to score.
Redmond's patient innings saw him face 192 balls and register his first test half-centruy.
Earlier, the BLACKCAPS' hopes of claiming the last two Tigers batsmen quickly when play resumed were dashed as they dug in to add another 58 runs to their overnight score of 184 for eight and push the target past 300.
The main obstacle was Mashrafe Mortaza who clubbed 44 from 87 balls until he gave part-time legspinner Redmond his first wicket in test cricket thanks to a smart stumping from Brendon McCullum.
Mortaza had earlier added 40 for the ninth wicket with Abdur Razzak before Iain O'Brien picked up the wicket of Razzak after Ross Taylor held a sharp chance at slip.
Shahadat Hossain then inherited the support role, negotiating 17 balls without scoring a run yet adding 22 with Mortaza for the final wicket before Redmond brought the curtain down with the score on 242.
The BLACKCAPS began their chase for 317 in bright fashion with How particularly aggressive. The opener hit five fours and six in his innings of 36 but it was his aggression that proved his downfall. He was bowled by Razzak trying to dab a ball to point only to see it hit his off stump.
But Redmond, who appeared content to play the sheet anchor role and Ryder, playing in his first test, overcame the hiccup to bat with discipline until Ryder was run out.
The burly left-hander had guided a ball down to third man in the third over before the close and was cauight short of his ground attempting a second run by a direct hit from Mortaza.
His 38 was a sedate innings compared to his one-day assaults but he was visbly upset with himself for getting out so close to the end of the day's play.
His dismissal brought Vettori to the crease and he and Redmond safely negotiated the final overs to see the BLACKCAPS to 145 for two at stumps to set up an intriguing final day.
The BLACKCAPS' previous best run chase abroad is the 164-4 made at the WACA in Perth to clinch the 1985 series with Australia.
The BLACKCAPS have never scored more than 300 in the fourth innings of a match on the sub-continent with the 272 for six compiled when drawing with India at Ahmedabad in 2003-04 their best efort to date.
Read more from
Cricket-New Zealand face tall order in first test
Black Caps fight back
The Press Association
We were more patient - Redmond
New Zealand 145-2 at stumps, chasing 317 to beat Bangladesh
International Herald Tribune
Redmond fifty gives Kiwis glimmer of hope
Reuters South Africa, South Africa
Black Caps hunt history
TVNZ, New Zealand