The tourists resumed on 161-6 but managed to reach 264 all out, Kamran Akmal (70) and Umar Gul adding 64 runs for the eighth wicket.
They then dismissed New Zealand for 99, with paceman Mohammad Asif and spinner Danish Kaneria taking seven wickets.
Pakistan lost Imran Farhat and Salman Butt as they reached 64-2.
It was a fine day for Pakistan, who had Akmal and Gul to thank for a respectable first-innings total after Mohammad Aamer had departed for 21.Wicketkeeper Akmal, who claimed his 11th Test half-century, survived two umpire reviews before he was dismissed when New Zealand captain Daniel Vettori made a good catch running back from mid-off off the bowling of Daryl Tuffey.
It did not take long for the hosts to wrap up the innings, Asif (four) and Gul (31) falling 20 minutes before lunch.
New Zealand did not start their reply well, Mohammad Aamer taking the wicket of Martin Guptill for a first-ball duck while Asif dismissed Tim McIntosh for four to leave the home side on 5-2.
Ross Taylor and Daniel Flynn combined for 43 before Taylor was bowled by Gul while the paceman struck against in the next over, Peter Fulton going for a two-ball duck.
Flynn and Grant Elliott added 33 runs either side of tea but the partnership ended with the score on 85 when Flynn became his team’s fifth victim – trapped leg before by Asif for 29.
Flynn’s wicket sparked a collapse, with New Zealand losing their last five wickets for 14 runs.
Pakistan’s openers took their team’s second innings to 49 before O’Brien claimed the wickets of both. Salman Butt went for 18, caught by Taylor, then Farhat followed for 35 – which included four fours and a six – when Fulton caught him at second slip.