The partnership of 157 between left handers Tamim Iqbal and Mominul Haque for the third wicket also set up the prospect of a fascinating final day in the series at the Shere Bangla Stadium, with both teams fancying a chance to push for victory.
Bangladesh will start the day on 269 for three, holding an overall lead of 114, with Mominul on 126, his second century of the series, and allrounder Shakib al Hasan on 32.
In Mominul, Bangladesh have a new batting hero.
Playing just his fifth test the diminutive 22-year-old followed his 181 in the first test with another fine performance.
He battled fatigue later in the day but showed piles of concentration and resolve, and a willingness not to let the tension of the occasion curtail his shotmaking abilities.
His stand with Iqbal, which carried Bangladesh from a dicey 55 for two - having trailed New Zealand by 155 on the first innings - was a record for the third wicket against any country.
Iqbal, usually a dashing figure who invariably gives the bowlers an opportunity, dropped anchor as he grafted his way to 70, off 218 balls.
It was a highly uncharacteristic display from the 24-year-old, who played for Wellington in last summer's HRV Cup.
He departed with a relatively rare attacking stroke, cutting hard at offspinner Kane Williamson and edging to slip where Ross Taylor took a sharp one-handed reflex catch.
Mominul was particularly strong off his legs and cut the ball crisply and had fine timing. By stumps he had faced 225 balls and hit 16 fours.
He was stuck for several minutes on 99 - a score never achieved by a Bangladeshi in tests - as New Zealand's seamers tried to pressure him with seven fielders blocking the offside.
However Mominul finally sent the boisterous crowd into raptures driving a boundary back past bowler Neil Wagner.
Black Caps opening batsman Peter Fulton had plenty of praise for centurion Mominul.
"He's played very well. We spoke after the last game about our plans to him. We probably wanted to bowl a lot straighter to him and not give him any width outside off-stump. But he was very patient in his innings today. Left a lot of balls, when we did bowl him a bad ball more time or not he would hit it for four. He played very well and sometimes you have you take your hat off to the batters."
Wagner was New Zealand's most successful bowler, having removed Amanul Haque and Marshall Ayub before lunch, neither batsman moving their feet as they edged low catches to the slips.
New Zealand added only 18 to their overnight score before being dismissed for 437. The pre-lunch loss of two wickets had the tourists' firmly in charge.
However they were unable to press home the initiative. Mominul had one slice of luck on five, when a better throw would have had him run out. But his success was richly deserved.
With al Hasan, he ensured there would be no late tumbles, their unbroken stand being worth 57.
Fulton said there was still plenty of time for New Zealand to get into a position to claim the test and the series.
"There's still a lot of time to go in the game. We would have liked to have had at least one if not two more wickets tonight but there's still a lot of time left in the game. We need to come out tomorrow morning, if we can get a couple of wickets in that first hour I think it could be an exciting day.
"If there's a target to chase we'll try and win the game. Hopefully we can get some wickets and have a target to chase later on."