With the tourists needing to win to keep the series alive after losing the first two ODIs, they pinned New Zealand down at key times.
In the last eight overs, when New Zealand needed to lift the run rate, they were restricted to 48 runs and lost seven wickets of which 11 runs came in the final over.
Williamson, who uncharacteristically struggled to penetrate the field for much of his innings, made 73 but it took 101 deliveries to get there.
Rumman Raees returned figures of three for 51, Hasan Ali took three for 59 and Shadab Khan took two for 51 with his wickets coming of successive balls.
Also Read
New Zealand made a flying start with Martin Guptill and Colin Munro cracking sixes for their first scoring shots but the innings stalled soon after.
Munro only faced three balls from Faheem Ashraf in the second over -- a six, two and caught behind, and New Zealand were 15 for one after 10 balls.
On the first ball of the next over Williamson wanted to run two on a drive to deep point but Guptill was too slow to respond and was easily run out for 45.
With the introduction of Ross Taylor, playing his 400th innings for New Zealand across all formats, the pace started to quicken.
Williamson was given out leg before wicket to Shoaib Malik on 43 but the decision was overturned on review and he went on to 73 before he was well caught by Mohammad Hafeez on the second take off Rumman.
But in the 43rd over Taylor was trapped in front by Shadab and wickets fell regularly from there.
Henry Nicholls was caught and bowled off the first ball he faced leaving Mitchell Santner to deny Shadab a hat-trick.
Disclaimer: No Business Standard Journalist was involved in creation of this content