Scoreboard
Fawad Alam made 64 as Pakistan set England a seemingly unimposing total of 242 for victory.
The hosts began their run chase in confident fashion with opener Andrew Strauss making 57 from 54 balls, but they lost five wickets for 68 runs as Pakistan tightened the screw.
Eoin Morgan, in tandem with Luke Wright, steadied the England ship but Gul, who had earlier claimed the wickets of Strauss and Michael Yardy, tore through England's lower order.
He dismissed Morgan and Tim Bresnan in the same over, before taking the wickets of Stuart Broad and Graeme Swann to leave the tourists on the brink of victory.
Abdul Razzaq finished off the job with the wicket of James Anderson to leave the five-match series poised at 2-1 in England's favour.
Teams
England: Andrew Strauss (capt), Steve Davies (wkt), Jonathan Trott, Eoin Morgan, Ravi Bopara, Luke Wright, Tim Bresnan, Michael Yardy, Graeme Swann, Stuart Broad, James Anderson
Pakistan: Kamran Akmal (wkt), Mohammad Hafeez, Asad Shafiq, Mohammad Yousuf, Fawad Alam, Umar Akmal, Shahid Afridi (capt), Abdul Razzaq, Umar Gul, Saeed Ajmal, Shoaib Akhtar
Umpires: Billy Doctrove (WIS) and Richard Illingworth (ENG) TV umpire: Nigel Llong (ENG). Match referee: Jeff Crowe (NZL)