At lunch on the last day, the skipper was unbeaten on 50 for his 46th half-century with Stuart Broad on 10 and 164 more runs needed for an unlikely victory.
England could also bat out the last two sessions for a draw, but Pakistan need just three wickets on a turning pitch at Sharjah stadium to win the third and final Test.
Sending final warning: Malik delivers double blow to England on day four
England were in danger of losing the match before lunch but Adil Rashid (22) helped add 49 for the seventh wicket with Cook to delay Pakistan's win.
Cook punched paceman Rahat Ali for a single to reach 50 and has so far hit two boundaries in his 148-ball knock.
Pakistan, leading the three-match series 1-0 after winning the second Test in Dubai and drawing the first Test in Abu Dhabi, dominated with leg-spinner Yasir Shah (2-28) and left-armer Zulfiqar Babar (2-31).
Shoaib Malik retires from Tests
England were rocked right at the start of the day, losing four wickets in the space of 31 balls after resuming at 46-2.
Shah trapped Joe Root in the second over with a delivery that kept low and caught the batsman in front of the stumps before he had added to his overnight score of six.
James Taylor survived nine deliveries to score two before Babar spun one across his bat for Younis Khan to take the edge in the slip. In the next over, Shah trapped Jonny Bairstow leg-before for nought.
Hafeez — redeeming his Test fortunes
It became 59-6 when Samit Patel was leg-before in Babar's next over, leaving England in fear of being bowled out for their lowest total of 72 against Pakistan they crumbled in Abu Dhabi in 2012.
But Rashid-Cook stand get England past 100-mark before Rahat bowled Rashid with 15 minutes to go before lunch.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ