Legspinner Ish Sodhi clean bowled Shan Masood for 13 and offspinner Mark Craig cut short Taufeeq Umar's comeback to Test matches after two years when he had him stumped on 16 just before the end of the day's play.
Pakistan were forced to draft in new opening batsmen as the in-form Ahmed Shehzad and Mohammad Hafeez were injured during the 248-run victory in the first Test last week.
But with the track showing ominous signs of turn, Masood and Umar struggled to cope against spinners before perishing late on the second day.
New Zealand were in danger of losing the initiative when it lost century-maker Tom Latham (137) and Corey Anderson (9) inside the first three overs in the morning after they resumed at 243-3.
Also Read
But Craig, dropped twice, and BJ Watling pinched Pakistan with a 68-run seventh-wicket stand, then Sodhi (32 not out) guided New Zealand to 400 with a straight six off Pakistan's most successful bowler, Zulfiqar Babar, who took 4-137.
Pakistan captain Misbah-ul-Haq was rewarded when he turned to Azhar, and the part-time legspinner immediately broke the two-hour, Watling-Craig partnership by having Watling caught at backward point on 39.
Pakistan had their chances to limit New Zealand, as Rahat Ali should have dismissed Craig on 9 just before lunch, but couldn't judge a high ball off a slog sweep and dropped a simple catch at mid-on. Craig got another reprieve on 13 in the first over after lunch when wicketkeeper Sarfraz Ahmed didn't attempt a low catch to his left off Ehsan Adil (2-73). Earlier, right-arm fast bowler Adil also met with immediate success off his fourth delivery of the morning when Anderson played an uppish drive off a full-pitched delivery and was caught in the covers.
Latham hit 11 fours and a six in his second successive century of the three-Test series. Neesham hit two straight boundaries off Adil on either side of the wicket in scoring 17, but struggled against the spin of Yasir Shah (2-92) and Babar on the slow-turning track. He eventually spooned a catch to Misbah at short midwicket.