The 21-year-old was on 79 not out to lift Bangladesh from a precarious 44-4 during an unbroken fifth-wicket stand of 139 with Mushfiqur Rahim (59 not out) to take the hosts to 183-4 at close on the opening day at Divisional Stadium.
Mehrab, who scored eight and six in his only Test appearance against Sri Lanka last year, played aggressively in an otherwise snail-paced batting performance by Bangladesh.
Rahim, a year junior to his partner, played equally well as New Zealand captain Daniel Vettori made bowling changes at regular intervals but failed to stop the duo from posting Bangladesh's best fifth wicket stand in all Tests.
The previous best fifth-wicket stand for Bangladesh was 126 posted by current skipper Mohammad Ashraful and Aminul Islam against Sri Lanka at Colombo in 2001.
Mehrab, only drafted into the final eleven after 14 frontline players defected to the Indian Cricket League last month, made the most of the chance, hitting ten boundaries during his 164-ball knock.
Rahim has so far hit nine boundaries and a six in his second Test fifty.
It was left-arm spinner Vettori (2-50) who jolted the Bangladesh batting after lunch, grabbing two of the three wickets to fall in the space of just ten runs.
Vettori dismissed opener Tamim Iqbal off the first delivery after the break, forcing an edge off the left-hander for a smart catch behind the stumps.
Iqbal, who was dropped twice by Aaron Redmond before reaching double figures, made 18.
Iain O'Brien then dismissed Rajin Saleh off an inside edge for a tedious 20 off 129 balls, before Vettori trapped Ashraful (two).
With the pitch expected to take spin, the home team went into the Test with four spinners and two seamers, while the visitors kept faith in Jeetan Patel and Vettori besides their three seamers.
Bangladesh gave a Test debut to off-spinning all-rounder Naeem Islam, while batsman Jesse Ryder made his Test debut for the visitors.
The second Test starts in Dhaka from October 25.