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.
"Chasing 242 you would back yourself to win at the Oval but Umar Gul in particular was outstanding," England captain Strauss told Sky Sports.
"Any time a bowler gets six wickets for 42, generally he is going to be in the winning side.
"To be fair to Umar, he got the ball reversing both ways and that is always tough to contend with."
England's bowlers quickly took the fight to their opponents, reducing Pakistan to 31-3.
Alam and Asad Shafiq steered Pakistan out of immediate danger, adding 64 runs before the latter was caught off the bowling of Swann.
Alam dug in and scored 64 before he was caught by Strauss at midwicket having lifted the tourists to 181-6.
Anderson and Bresnan, who claimed three wickets apiece, cleaned up the tail and England began their run chase brightly.
Openers Strauss and Steven Davies put 35 on the board before Abdul Razzaq up-rooted Davies's off stump and Shoaib Akhtar ensured Jonathan Trott quickly followed him back to the pavilion with a difficult, inswinging yorker.
England collapsed to 103-5 before Morgan and Wright brought some stability, adding 98 runs without loss.
Then Gul, who finished with figures of 6-42, took control as England's last four wickets fell for just 18 runs.
"I think we are capable of beating any good team," Pakistan captain Shahid Afridi said.
"I didn't think our total was enough; I thought we were 30 or 40 runs short, but good teams can defend any total. Umar Gul was amazing."
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