New Zealand who had been comfortable at 252-4 were 260-7 in reply to Bangladesh’s 289 when rain ended play about 40 minutes early at Hagley Oval.
Shakib, with his mesmerising left-arm spin, had taken three wickets for three runs in nine deliveries.
Henry Nicholls was not out 56 with Tim Southee on four.
Sarkar lifts Bangladesh, Southee inspires New Zealand
Until Shakib’s one-man fightback, New Zealand were advancing towards a first innings lead after a century stand by Ross Taylor (77) and Tom Latham (68) laid the groundwork following an early collapse.
Taylor, needing one more century to equal the New Zealand record of 17 held by his mentor the late Martin Crowe, entered the fray following the cheap dismissal of Kane Williamson when New Zealand were trouble at 47-2.
The veteran batsman batted for 160 minutes, piercing the field with a series of cuts and pull shots and survived a dropped catch on 75 before being dismissed two runs later and 23 short of matching Crowe’s record.
New Zealand send bouncer warning Bangladesh’s way
He did achieve one milestone, though, becoming the third New Zealander and fastest to 6,000 Test runs when he drove Mehedi Hasan for three to reach 62 in his 145th innings.
Brendon McCullum took 163 innings to each the mark and Stephen Fleming 165.
Latham, backing up from a career-best 177 in the first Test was untroubled in his partnership with Taylor until he uncharacteristically edged a wide Taskin Ahmed delivery to give wicketkeeper Nurul Hasan his first Test dismissal.
Taylor soldiered on for another nine overs until he scooped Mehedi to substitute fielder Taijul Islam.
NZ aiming to rise in Test rankings against Bangladesh
The umpires debated whether the ball hit the pitch first before ballooning out to Taijul but video replays confirmed it was a legitimate dismissal.
Kamrul made the early breakthrough for Bangladesh in his opening over when he removed opener Jeet Raval for 16 and Williamson for two in the space of three deliveries.
The Bangladesh bowlers had reason to feel aggrieved with at least four catches put to ground and a caught behind to remove Nicholls on 45 was rejected.
Television replays suggested the catch appeal had merit but Bangladesh had used up their two review opportunities.
When Mitchell Santner was given out leg-before to Shakib Al Hasan for 29 and appealed the decision, the umpire's decision was upheld but New Zealand did not lose a review because of the ball-tracking technology.
Santner and Nicholls put on 75 for the fifth wicket.
Shakib bowled BJ Watling for one and Colin de Grandhomme without scoring to finish the day with three for 32.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ