Resuming at 281-6, Sarfraz Ahmed reached a fighting 111 not out and added 80 for the unfinished 10th wicket stand with Rahat Ali, who was 16 not out after the extended two-and-a-half hour session.
Pace partners Tim Southee has figures of 3-67 and Trent Boult took 2-69.
Pakistan lead the three-Test series 1-0 after their 248-run win in the first Test in Abu Dhabi last week.