Dubai United Arab Emirates: Pakistan was frustrated by New Zealand's tailenders before left-arm spinner Zulfiqar Babar claimed 4-137 to help dismiss the Black Caps for 403 on the second day of the first test on Tuesday.
New Zealand was in danger of losing the initiative when it lost century-maker Tom Latham (137) and Corey Anderson inside the first three overs in the morning after it resumed at 243-3.
But Mark Craig (43), dropped twice, and BJ Watling (39) pinched Pakistan with a 68-run seventh-wicket stand, and Ish Sodhi put on a further 39 runs with Tim Southee to guide New Zealand beyond the 400-run mark.
Sodhi remained unbeaten on 32 and raised the 400 with a straight six over Babar's head.
Fast bowler Ehsan Adil took 2-73, while legspinner Yasir Shah bagged 2-92.