Williamson scored a 91-ball 70 not out for his 12th fifty — his sixth in his last seven matches — to help New Zealand chase down their 253-run target in 46 overs at Sharjah stadium to level the five-match series at 1-1.
New Zealand had raced to 103 by the 19th over with Anton Devcich (58) and Dean Brownlie (47) batting solidly against some erratic pace bowling by Pakistan.
But part-time spinner Haris Sohail, who had no wicket in his previous five matches, turned the game on its head by dismissing Ross Taylor (two), Tom Latham (three) and Corey Anderson (10) to finish with 3-48.
Leg-spinner Shahid Afridi (2-47) had given Pakistan the breakthrough with Brownlie’s wicket before New Zealand lost five wickets in the space of just 64 runs.
With 86 needed off 17.3 overs, Williamson added an invaluable 58 runs for the sixth wicket with Luke Ronchi (36).
Even when Afridi dismissed Ronchi, who hit six boundaries in his rapid 32-ball knock, Williamson and Daniel Vettori (13 not out) stayed on course.
Williamson hit seven boundaries.
A packed 16,000 holiday crowd at Sharjah stadium enjoyed a game in which both teams had their moments.
Pakistan had won the first match by three wickets in Dubai.
The remaining matches will be played in Sharjah (Sunday) and Abu Dhabi (Wednesday and Friday).
Earlier, Hafeez hit a 92-ball 76 with nine boundaries and a six while skipper Misbah-ul Haq chipped in with a 65-ball 47 to rescue Pakistan, who won the toss and batted, from a shaky 20-3 before they were bowled out for 252 in 48.3 overs.
With his position under threat after his suspension over his illegal bowling action, Hafeez struck form in the nick of time as he added 77 for the fourth wicket with Sohail (33) and another 66 for the fifth with Misbah.
Henry had jolted Pakistan by dismissing opener Ahmed Shehzad, caught behind in the first over for a duck and then bowled Asad Shafiq (one) in his third.
In between, seamer Mitchell McClenaghan, who took 3-56, had Younis Khan for six.
When it looked as if Pakistan would post a 300-plus total Henry took Hafeez and Misbah, caught behind in the space of nine runs.
Misbah, who hit two fours and two sixes, wasn’t happy with English umpire Richard Illingworth’s decision and reviewed the decision, but it was to no avail.
His dismissal at 172 seemed to have derailed Pakistan’s innings but Afridi hit three sixes and a boundary in his 14-ball 27 while Sarfraz Ahmed made 23.
Pakistan brought in Sohail Tanvir for Umar Gul, who was struggling for fitness while New Zealand were forced to make three changes.
Paceman Kyle Mills, all-rounder Jimmy Neesham and spinner Nathan McCullum made way for McClenaghan, Anderson and Henry. -AFP