Pakistan's four early wickets had set up the possibility of all results at tea but in the end Pakistan fell 65 runs short when bad light finished play five overs early.
Asad Shafiq scored 41 not out and Sarfraz Ahmed 24 as Pakistan finished at 196-5 which kept their 1-0 lead in the series intact.
It was an exciting finish before an 8,000 holiday crowd who anticipated a Pakistani win after New Zealand captain Brendon McCullum had sportingly declared his second innings at 250-9.
Younis (44) and Shafiq lifted Pakistan from a precarious 75-4 after Trent Boult had dismissed Shan Masood (40) and skipper Misbah-ul Haq (nought) in his successive overs.
More From This Section
Pakistan, needing 130 in the last 20 overs, picked up the tempo with Shafiq hitting two boundaries off Mark Craig but the off-spinner derailed the chase when he dismissed Younis with a turning delivery which rose on the batsman and the ensuing edge was well taken in the slip.
Younis hit three sixes and two boundaries in his 84-ball knock.
Pakistan won the first Test by 248 runs in Abu Dhabi last week.
The third and final Test starts in Sharjah from November 26.
Pakistan had lost opener Taufeeq Umar for four in the second over to Tim Southee before Masood and Azhar Ali (24) put on a solid 62 for the second wicket.
Ali then hit a Craig full toss straight into the hands of covers before Boult trapped Masood leg-before and had Misbah caught behind off a beautiful delivery.
Masood was shaping well during his 95-ball knock, hitting two sixes and a boundary.