Pakistan, set a target of 176 to win, were 37-0 at close on the third day of the first Test against New Zealand in Abu Dhabi on Sunday.
Imam-ul-Haq (25) and Mohammad Hafeez (8) were at the crease till the end on the third day. Pakistan will need another 139 runs to defeat New Zealand who were all out at 249 in their second innings.
Medium pacer Hasan Ali took his maiden five-wicket haul with 5-45 while leg-spinner Yasir Shah finished with 5-110 — his 14th five-wicket haul in an innings — as New Zealand lost their last six wickets for 29 runs.
BJ Watling (59) and Henry Nicholls (55) added 112 for the fifth wicket.
New Zealand made 153 in their first innings to which Pakistan replied with 227 all out.
New Zealand, which surrendered a first innings lead of 74 runs, were 60 runs ahead with BJ Watling batting on 15 and Henry Nicholls unbeaten on 13 at the break.
Watling survived in the last over before lunch when he successfully reversed an lbw decision against him off Bilal Asif's off spin as the television replays showed the ball would have missed the leg stump.
Hasan used the reverse swing with perfection by nipping Ross Taylor (19) plumb leg before wicket.
Four balls later Jeet Raval's (46) resistance finally ended when he edged the right-arm fast bowler behind as New Zealand slipped to 108-4.
Earlier, left-handed Raval was aggressive against leg-spinner Yasir Shah when New Zealand resumed on 56-1 and quickly wiped off the first innings deficit.
Raval used his feet well against Shah by hitting three boundaries in the leg-spinner's first two overs.
However, Captain Safraz Ahmed persisted with Shah and the leg-spinner finally got the breakthrough.
Kane Williamson (37) added 10 to his overnight score of 27 before Shah bowled the New Zealand skipper off a delivery which moved enough and tipped the off stump bail to break the 86-run second wicket stand.
Taylor was also dominant against Shah by smashing three fours in leg-spinner's one over that included two meticulous cuts and one over mid-wicket.
But Hasan's twin strikes in his fourth over of the day pegged back New Zealand's progress as the fast bowler provided Pakistan with an edge.