England struggled in the pursuit of a 277 victory after falling from the fourth day to 117-5.
But Woakes, who had helped drag England back into the match 2-11 in just five overs last Friday, and fellow World Cup winner Jos Buttler turned the tide with a stand of 139.
However, with just 21 more runs needed, Buttler was up for 75 lbw after Yasir Shah tried to switch from the leg spinner.
The batsman struggled but all to no avail, with England now 256-6.
By the time Pakistan left-handed fast bowler Shaheen Afridi took the new ball, England still needed just 13 runs to win at a solar-powered Old Trafford.
But there was still time for England to lose their seventh wicket when, with four more needed, Stuart Broad plumb lbw was on the sweep to Yasir.
Chris Woakes in first # ENGvPAK Test: 4️⃣ Wickets1️⃣0️⃣3️⃣ runs, including 84 * in fourth innings! He has … https://t.co/W7t6wi5Eif
– ICC (@ICC) 1596909434000
However, Woakes ended the match with a refreshed boundary from Afridi to the third man’s sail as England went up 1-0 in a three-match campaign.
Victory meant that England won an opening test for the first time in six series.
Defeat was heavy on Yasir, who took eight wickets in the match.
Wicketkeeper Buttler had a bad game in the field, twice missing Shan Masood at 45 in the Pakistan opener’s 156 which was instrumental in leaving England with a first-innings deficit of more than a hundred runs.
But whether it was the driving leg-spinner Shadab Khan as teenage paceman Naseem Shah pulled for another frontier, Buttler put the pressure back on Pakistan.
Buttler’s fifty came off just 55 balls, with seven fires, with Woakes failing to hit in a 59-ball fifty he completed by driving Naseem for cover for the eighth boundary of his innings.
It was Woakes the highest test score since his hundred against India two years ago.
Although Woakes is known to be vulnerable to the short ball, Pakistan did not catch short for the all-rounder until he was well set up.
Twice more, a team has chased more than 200 to win in the fourth innings of a Test at Old Trafford, with England 294-4 against New Zealand in 2008 and 231-3 against the West Indies in 2004.
Earlier, England lost four wickets for 31 runs in sliding to 117-5, with captain Joe Root and Ben Stokes both in the column.
The decline began when Dom Sibley (36) advised a Yasir station to slide.
Root made 42 before nodding Naseem to Babar Azam in the panties.
Stokes had guided England to an astonishing one-wicket win over Australia from a seemingly hopeless position with a brilliant century in the third Ashes Test last year.
But there was no replay of his Headingley heroes on Saturday, when he fell for just nine, with wicketkeeper Mohammad Rizwan, impressively behind the stumps in this match, and holding an excellent catch after Stokes got a thin glove after a Yasir -googly who jumped.
Ollie Pope then received a brute from a delivery from Afridi who shot a length, the ball balloon to Shadab as he ran forward from the ball.
Pakistan was brought back to 137-8, a lead of 244.
Yasir led a tailend rally in which 32 runes were added in just 16 balls before his team was dropped for 169 in their second innings.
Yasir hit a quickfire 33 off 24 balls, but it was ultimately not enough to compensate for the loss of four wickets on Friday.
.