The hosts had resumed well placed on 104 for three with Jeet Raval on 55 and Henry Nicholls on 29, but Pakistan settled into a testing line and length and only some power hitting from Colin de Grandhomme (29) and Tim Southee (22) inflated the lead.
Neil Wagner (21) was the last man out, giving Rahat his fourth wicket of the innings, while Trent Boult was left three not out.
(Reporting by Greg Stutchbury in Wellington; Editing by Peter Rutherford)