Rashid, who had the worst bowling figures on debut in the first innings of 0-163, had an unbelievable change in his fortunes as he grabbed 5-64 to dismiss Pakistan for 173 on a weary fifth day Sheik Zayed Stadium pitch.
England tried hard to chase down the 99-run target in a possible 19 overs but umpires called off play eight overs early due to bad light with the visitors on 74-4.
Joe Root finished with 33 in the fading light as Pakistan attacked with spinner Zulfiqar Babar (2-27) and Shoaib Malik (2-25) to keep the slate clean in the three-match series.
A result had looked highly unlikely on the fifth morning as England, replying to Pakistan’s 523-8 declared, closed their first innings at 598-9.
But Pakistan’s notoriously undependable batting changed the complexion as Rashid exploited the rough with seven wickets falling for 71 runs, the last five for only 14 in the post tea session.
Only skipper Misbah-ul-Haq put up some resistance with 51 on a day when 15 wickets fell, compared to 16 over the first four days.
England went after the target with Jos Butler joining Moeen Ali as opener but Pakistan checked them with some accurate bowling.
England lost Butler (4), Ali (11), Ben Stokes (two) and Jonny Bairstow (15) in the 11 overs.
It was a lucky escape for Pakistan as there have been 14 previous instances when teams had lost a Test after scoring 500 points or more, the highest by Australia when they lost to England after scoring 586 in Sydney in 1894.
Despite a slow and flat pitch both teams will regret missed opportunities which allowed Malik (caught off a no-ball on 40) to hit 245 in his comeback match and Cook scored 263 (dropped on 147 and 173).
The three-match series will resume in Dubai from October 22 with the final Test in Sharjah from November 1.
Pakistan had hoped Younis Khan (45) and Misbah would handle the situation at 47-3 after opener Mohammad Hafeez was run out for 34, failing to beat an excellent throw by Stokes from the covers while taking a sharp single.
But soon after tea, Younis tried to play a big shot off spinner Moeen Ali (2-28) to be caught in the covers while Misbah jumped out to heave the same bowler and was bowled.
The Pakistan skipper hit six boundaries in his 30th Test half century.
Rashid then came into his own, dismissing Zulfiqar Babar (one), Sarfraz Ahmed (27) and Imran Khan in successive overs.
Earlier, it was Anderson (2-30) who enlivened an otherwise dull Test by taking two wickets in an over before lunch.
Anderson dismissed opener Shan Masood (one) and Shoaib Malik (nought) in the third over to leave Pakistan wobbling at 3-2.
Masood, who was bowled after a short delivery from Anderson deflected onto the stumps from the grill of his helmet in the first innings, played on to the same bowler.
Malik, who scored a career best 245 in the first knock, lasted three deliveries before Anderson’s bouncer surprised him as his evasive shot landed safely in Jonny Bairstow’s hands.
Younis also survived a shaky start, but Hafeez, fresh from his 98 in the first knock, hit four boundaries and a six before his dismissal.
England, resuming at 569-8, had lost Rashid (12) before Stuart Broad (17 not out) and Anderson (three) remained unbeaten.
Left-arm paceman Wahab Riaz was the pick of Pakistan bowlers with 3-125 while Babar finished with 1-183 off 72 overs.
Nov 15, 2017 0
Feb 18, 2018 0
Feb 18, 2018 0
The 68th Anniversary of the Founding of the People’s Republic of China.
— The Daily Mail - People's Daily