Two late wickets to Daniel Vettori with the second new ball saw the Tigers' end the day on 180 for eight and the tourists will be hoping to wrap up the innings early on day four to limit the total they will have to chase.
They will need a dramatic improvement on their first innings effort after they were limited to 171 - a new all time low against their hosts - to hand Bangladesh a 74-run first innings.
The Tigers set about almost squandering their advantage to lose five wickets for 71 when batting a second time and put their hopes of a first test win against a major test-playing nation on hold.
But Shakib Al Hasan, fresh from ripping the heart out of the BLACKCAPS' batting lineup with seven wickets, turned tormentor with the bat to chalk up his maiden test fifty and take the lead past 200.
Shakib finally fell for 71, but shared in a crucial stand of 56 with Mushfiqur Rahim for the sixth wicket when the hosts were in danger of failing to extend their hard-fought first innings lead into a potentially match-wining target.
Earlier in the day the BLACKCAPS added 16 runs to their overnight total to be all out for 171 - their lowest ever total against Bangladesh.
No. 11 Iain O'Brien was the wicket to fall, bowled by left-arm spinner Shakib to give the 21-year-old the superb figures of seven for 36 from 25.5 overs and record the best innings analysis by a Bangladesh bowler.
BLACKCAPS skipper Vettori ended unbeaten on 55 bringing up his 17th test half-century in the process.
Bangladesh's hopes of just their second test win were dealt an early blow when Kyle Mills caught the edge of Junaid Siddique's bat for second slip Aaron Redmond to take a simple chance.
It was then the turn for Vettori and Jeetan Patel to shine, combining to share four wickets and reduce the hosts to 71 for five and lift the BLACKCAPS' hopes of limiting the total they will have to chase.
Patel struck first, as he did in the first innings, when a perfectly flighted delivery jagged back to trap Rajin Saleh leg before wicket for six when the score was 36.
While Saleh's lack of footwork let him down, captain Mohammad Ashraful was let down by poor decision making.
Facing just his second ball from Vettori, he advanced down the wicket and sliced the ball to Redmond at cover who clung on to a difficult chance and Ashraful departed without scoring.
Patel enticed Mehrab Hossain jnr, who made 83 in the first innings, to miscue to Mills at mid on and when Tamim Iqbal was caught and bowled by Vettori the hosts looked shaky.
But up stepped Shakib and wicketkeeper-batsman Rahim to salvage the situation and it came as something of a surprise when Rahim dragged a ball onto his stumps from O'Brien to leave the score at 127 for six.
Shakib, who hit Patel for three fours in one over after reaching fifty, found another worthy ally in debutant Naeem Islam to compound the misery on the BLACKCAPS.
He mixed attacking flourishes with resolute defence and it took Vettori, who opted to take the second new ball himself and a smart juggling catch by Ross Taylor at slip to end his resistance.
Naeem went soon after for 19, also to Vettori, but the pair had added 48 and did enough to ensure the BLACKCAPS will need to score their highest total abroad to win a test match, while Vettori ended the day with figures of 4-39.Read more from
Shakib shines with bat after seven-wicket haul
Cricket: Bangladesh imitates Kiwis' woeful batting
New Zealand Herald, New Zealand
Bangladesh takes 258-run lead in first test against New Zealand
International Herald Tribune, France
Hasan puts Bangladesh in command
Black Caps shocked by Shakib