The touring side finished day two on a strong 175-2, 153 behind but hopeful of a first-innings lead after their bowlers did an excellent job in the morning session to restrict New Zealand to a sub-350 score.
Mahmudul, playing only his second Test, was batting on a resolute 70 with skipper Mominul Haque on eight at the other end at the Bay Oval.
Earlier resuming on 258-5, New Zealand added 70 runs in the morning session before losing their last five wickets three overs before the lunch break.
Overnight batsman Henry Nicholls hit 12 boundaries in his 75 and was the last New Zealand wicket to fall.
For the touring side, paceman Shoriful Islam and off-spinner Mehidy Hasan claimed three wickets apiece.
Bangladesh got off to a decent start with Shadman Islam and Mahmudul adding 43 runs for the opening stand.
Neil Wagner broke the stand when he caught Shadman, who made 22, off his own bowling but Mahmudul and Najmul frustrated the host with a century stand.
Both the batsmen took time to get their eyes in and had their moments of discomfort but soldiered on.
“The century-plus partnership between them was important for us,” Mehidy told reporters afterwards.
“We were missing top-order partnerships in recent times. This will give us a lot of confidence and there’s lot of cricket to play in the match.”
Najmul, who made 64, brought up his fifty in style slog-sweeping spinner Rachin Ravindra for a six before Wagner had him caught in the gully.
“Full credit to the Bangladesh batsmen, I thought they played really well,” Wagner told reporters.
“They showed a lot of patience…it was a good day of hard Test cricket.
“I think we tried really hard. We just couldn’t really string it together and create enough pressure from both ends.”
©2021 The New York Times Company