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 from a shaky 20-3 after they won the toss and elected to bat at Sharjah stadium.
Pakistan lead the five-match series 1-0 after winning the first game in Dubai by three wickets.
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 Haris Sohail (33) and another 66 for the fifth with Misbah.
In between seamer Mitchell McClenaghan, who took 3-56, had Younis Khan for six. Yunis failed to capitalise on a no-ball leg-before by the same bowler on nought.
Also Read
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.
McClenaghan dismissed Ahmed and Sohail Tanvir (14) in the 49th over to wrap up the innings.
Pakistan brought in 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, Corey Anderson and Henry.