Tim McIntosh (31) and BJ Watling (13) will continue for the hosts in the morning.
Earlier, Pakistan won the toss and opted to bat, but they did not live up to expectations as they lost their first five wickets for 51 runs, courtesy of a sublime bowling spell from Iain O'Brien whose figures at one point read 5-4-3-4.
O'Brien - playing in his last test after announcing retiring from international cricket during the last match - bowled with pace and control, taking care of Faisal Iqbal (6), Mohammad Yousuf, Umar Akmal and Misbah-ul-Haq, the last three for ducks.
At lunch, the visitors would have kicked themselves, squandering winning a good toss, as they went into the break on 83 for five.
Though Kamran Akmal fell in the second over after the interval, Pakistan managed to pull themselves together somewhat as Imran Farhat and Mohammad Aamer added 69 for the seventh wicket before the latter fished at another delivery just to edge it to Brendon McCullum behind the stumps.
In the meantime, Farhat continued his streaky innings, having bothered the slip region many times with edgy fours, to reach a well-grafted century before tea. It wasn't pretty, but was pretty effective under the circumstances.
Umar Gul and Farhat safely saw their team to tea on 180/7, having lost only two wickets in the afternoon session.
However, that was all to change as Daryl Tuffey first sent Gul back, and Mohammad Asif followed the very next ball.
Tuffey mopped it up with the wicket of Danish Kaneria who swung lustily and added a fortunate 16 runs to the tally.
Farhat carried his bat for 117 runs - his third test century - facing 169 deliveries and striking 14 fours and one six.
O'Brien ended up with 4/35 and Tuffey finished with 4/52.
Teams: