The 21-year-old turned his left arm with magical effect to take 6-31, leaving the tourists reeling at 155-9 after Daniel Vettori took five wickets to shoot Bangladesh out for 245 in the first innings.
Vettori the batsman then held fort for the visitors as he went unbeaten on a pugnacious 48 with number ten Jeetan Patel falling in the last over of the day for nought, leaving the tourists 90 runs behind.
Hasan, better known for his left-handed batting, had Jamie How (16) and debutant Jesse Ryder (one) out in successive overs, before trapping Aaron Redmond (19) to wrestle back the initiative for the home team.
Hasan, who had just three wickets to show in his previous six Tests, then got the prized wickets of Brendon McCullum (25) and Jacob Oram (nought) to leave New Zealand in tatters at 100-7 before Vettori and Kyle Mills put up some fight.
In between left-arm spin partner Abdur Razzak trapped Ross Taylor for 12.
Daniel Flynn (19) and McCullum did try to take the attack to the bowlers, with Flynn hoisting two boundaries and a six before he edged to wicket-keeper Mushfiqur Rahim to give debutant Naeem Islam a wicket in his first over.
Vettori and Mills (four) added 26 for the eighth wicket before Hasan struck again, forcing an edge off Mills to the keeper. Hasan's previous best of 2-44 was against the same opponents at Wellington in January this year.
Bangla should prove their Test credentials
In the morning Vettori took three of the six wickets to fall in the space of just 57 runs to finish with 5-59, his 16th five-wicket haul on a slow Divisional Stadium pitch.
The 29-year-old spinner dismissed Rahim (79), Mashrafe Mortaza (nought) and Razzak (11) after Bangladesh resumed at the overnight score of 183-4.
Vettori was ably supported by paceman Iain O'Brien (3-36) and off-spinner Patel who finished with 2-67.
Bangladesh were pegged back from the start, losing Mehrab Hossain to O'Brien in the fourth over of the day for a fine career-best 83.
Mehrab, playing only his second Test, miscued a drive and was caught at short cover by Redmond. He hit 11 boundaries during his resolute 179-ball knock.
Mehrab and Rahim added an invaluable 144 for the fifth wicket.
Rahim also added 41 for the sixth wicket with Islam (14) before Vettori dismissed him off a miscued sweep. Rahim struck 12 boundaries and a six during his 209-ball innings.
The second Test starts in Dhaka from October 25.
New Zealand tour of Bangladesh-Reports