The three-wicket win in the rain-abridged match also wrapped up the series for New Zealand 2-0.
Initially set a target of 291 to win, New Zealand made a disastrous start with Brendon McCullum out for a first-ball duck.
But Guptill and Williamson restored order with a 159-run stand, a New Zealand ODI record for the second wicket, to set the side up before a lengthy rain delay shortened the match by seven overs.
With 27 balls remaining and New Zealand still 38 runs short of their target, Corey Anderson appeared to have been caught behind but was given not out and Pakistan had used up their review.
The ODI series win added to New Zealand's golden summer after they also beat Pakistan 2-1 in the Twenty20s and beat Sri Lanka in Tests, ODIs and Twenty20s.
In the decider against Pakistan, Azhar Ali won the toss and opted to bat first which initially proved productive.
But they were soon to run out of steam with their last
six wickets falling for 63 runs and they were all out for 290 with 15 balls remaining.
McCullum's comeback was very brief after being sidelined for five weeks by a back complaint.
The first ball he faced from Mohammad Amir was hooked to long leg where Mohammad Irfan took a smart catch on the run.
Enter Williamson to partner Guptill in a record stand, two better than the previous best 157 which Guptill had set with McCullum four years ago against Zimbabwe.
Guptill was first to go for 82 caught at point by Hafeez, and Williamson was stumped for 84.
Azhar may consider himself a part-time bowler but showed all the guile of a career leg-spinner when he outwitted Williamson charging down the wicket by getting the ball through to wicketkeeper Sarfraz Ahmed.
Henry Nicholls, who set up the first ODI win, and Grant Elliott both fell cheaply as New Zealand slipped from 165-1 to 210-5.
Lusty hitting from Anderson with 35 off 29 narrowed the gap and with six required off the last over, Mitchell Santner hit boundaries off the first and fourth deliveries to get New Zealand home.
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
