Victory left England 2-1 up in the four-match series ahead of next week's concluding Test at The Oval.
It also meant England had become the first team in 114 years of Test cricket at Edgbaston to win after conceding a lead of more than 100 runs batting first.
Pakistan, set a huge target of 343 for victory after England declared on 445 for six early on Sunday's final day, were dismissed for 201.
Off-spinner Ali, who earlier in the day struck a quickfire 86 not out, sealed England's win when he caught and bowled tailender Sohail Khan.
Pakistan suffered a dramatic middle-order collapse shortly before tea as they lost four wickets for just one run in 23 balls.
It was the sixth time this series that paceman Woakes had taken a wicket in the first over of a spell.
- Aslam error
-Sami Aslam, playing his first Test of the series, had again batted superbly for 70 following the opener's first-innings 82.
But a rare misjudgement by the 20-year-old left-hander saw him bowled by Finn as he deliberately left the ball.
It was the end of a more than three-and-a-half-hour innings of 167 balls, including 11 fours.
Finn had now taken two for none in 11 balls and tea was put back by 15 minutes to see if England could finish the game.
But instead they had to content themselves with a session where they took six wickets for 79 runs.
With all their specialist batsmen dismissed, the question for Pakistan was could their tailenders somehow survive the remaining 28 overs to hold out for a draw.
Pakistan were on the brink of defeat at 151 for nine when Amir drove Stuart Broad straight to Woakes at point.
But a last-wicket stand of 50 in 67 balls between Sohail and Rahat Ali (15 not out) kept England at bay before Moeen Ali struck the clinching blow with 13.1 overs left in the day.
All five of England's frontline bowlers -- Anderson, Broad, Finn Woakes and Ali -- took two wickets apiece Sunday.
Ali, who also made a first-innings fifty, was named man-of-the-match.
But Moeen Ali dismissed Azhar on 38 when he edged a loose drive to England captain Alastair Cook at second slip.
Cook decided against declaring before the start of Sunday's play even though England had a lead of 311 runs.
Jonny Bairstow was 82 not out and Ali 60 not out after their century stand had taken the match away from Pakistan on Saturday.
Birmingham-born Ali, who grew up near Edgbaston, struck 19 runs in the first over of Sunday's play from leg-spinner Shah, including two successive sixes.
Bairstow had added just one run to his overnight score when he was lbw to Sohail on review.
Ali had faced just 96 balls, including 10 fours and two sixes, when Cook declared just four overs into Sunday's play.