The 22-year-old off-spinner had Corey Anderson leg-before, Bradley-John Watling caught behind and Doug Bracewell caught in the slips off successive balls at the Zahur Ahmed Chowdhury stadium.
Gazi's hat-trick, which gave him his sixth wicket in the innings, saw the Black Caps slump from 260-4 to 260-7 in their second knock after lunch on the fifth and final day.
The tourists declared the innings closed at 287-7, leaving Bangladesh a target of 256 runs in a minimum of 45 overs to win the Test and take the lead in the two-match series.
Gazi, who hit an unbeaten 101 on Saturday, joined Alok Kapali as only the second Bangladesh bowler to claim a Test hat-trick.
Kapali had achieved the feat against Pakistan in Peshawar in 2003 when he dismissed tailenders Shabbir Ahmed, Danish Kaneria and Umar Gul in three consecutive deliveries.
The draw loomed after New Zealand made 469 in their first innings and Bangladesh replied with 501 on a newly-laid pitch that provided no assistance to the bowlers.
Bangladesh have yet to win a Test against New Zealand, having lost eight and drawn one of their nine previous matches against the Black Caps.
The second Test will be played in Dhaka from October 21 to 25, followed by three one-day internationals and one Twenty20 match.
You’ve reached your limit of {{free_limit}} free articles this month.
Subscribe now for unlimited access.
Already subscribed? Log in
Subscribe to read the full story →
Smart Quarterly
₹900
3 Months
₹300/Month
Smart Essential
₹2,700
1 Year
₹225/Month
Super Saver
₹3,900
2 Years
₹162/Month
Renews automatically, cancel anytime
Here’s what’s included in our digital subscription plans
Exclusive premium stories online
Over 30 premium stories daily, handpicked by our editors


Complimentary Access to The New York Times
News, Games, Cooking, Audio, Wirecutter & The Athletic
Business Standard Epaper
Digital replica of our daily newspaper — with options to read, save, and share


Curated Newsletters
Insights on markets, finance, politics, tech, and more delivered to your inbox
Market Analysis & Investment Insights
In-depth market analysis & insights with access to The Smart Investor


Archives
Repository of articles and publications dating back to 1997
Ad-free Reading
Uninterrupted reading experience with no advertisements


Seamless Access Across All Devices
Access Business Standard across devices — mobile, tablet, or PC, via web or app
