BJ Watling and Trent Boult recorded the second-highest 10th wicket partnership for New Zealand as they reached 469 before Bangladesh hit back on the second day of the first Test.
The pair came together with the Black Caps wobbling after a morning collapse on Thursday but batted brilliantly - Watling the star with his second Test century.
Boult then struck with the second ball of the reply before the home side stabilised to reach 103-2 at stumps to trail by 366 runs in Chittagong.
New Zealand had closed on 280-5 on Wednesday, captain Brendon McCullum dismissed with the last ball of the day, and nightwatchman Bruce Martin (one) was first man out on the resumption.
Rubel Hossain took his wicket and three balls later Abdur Razzak lured Test debutant Corey Anderson into a defensive stroke that ended with the ball flying to Nasir Hossain at first slip.
New batsman Doug Bracewell made 29 runs off 72 balls, including four boundaries, by the time Sohag Gazi struck in the 113th over.
Watling was given little support by international newcomer Ish Sodhi, who fell leg-before-wicket to Shakib Al Hasan for a single run, but the fightback came in tandem with Boult.
Having fended off a pumped-up Tigers attack early on they slowly gained a foothold before batting with controlled aggression.
Watling eventually perished having made 103 and with their partnership of 127 the second best by a New Zealand duo, falling 24 short of the record set by Richard Collinge and Brian Hastings against Pakistan over 30 years ago.
Bangladesh appeared understandably downbeat when they got their innings under way and Boult, having started with a wide, tempted Tamim Iqbal to drive at a ball outside off-stump which flew to Kane Williamson in the gully.
It was soon 8-2 when Anamul Haque, having already survived an edge off a no-ball, was trapped leg before wicket by Bracewell.
The tourists were firmly in the ascendancy but then came the Bangladesh fightback, led by Mominul Haque.
The 22-year-old left-hander decided attack was the best form of defence and produced a fine repertoire of strokes to reach 77 not out off 71 balls by the close.
The more circumspect Marshall Ayub was the perfect foil with 21 as Bangladesh battled hard.