England were cruising but the loss of Jason Roy, caught by Fakhar Zaman on 64, at the halfway point led to a nail-biting and breathless finish as the Pakistan spinners went to work and wickets fell.
Liam Livingstone came in to bat in the penultimate over, smashing his first ball for a mighty six and was then caught off the next, leaving England needing six runs from the final over.
Eoin Morgan went with four runs still required but Chris Jordan and David Willey did what was needed.
The white-ball match was the last home T20I for Morgan's England side before the World Cup in the United Arab Emirates and Oman in October.
"It means a huge amount," said Morgan of the win. "The style in which we play naturally, and the game which we are best at, I think this is the worst possible wicket that we can actually apply it on.
"So it's a very proud day for us. On a spinning, slow wicket we've managed to win a game against a very good side."
Pakistan had won the opener in Nottingham and England the second encounter in Leeds.
Leg-spinner Adil Rashid took four wickets for England, three from his first 10 balls and starting with captain Babar Azam stumped by Jos Buttler for 11 off a googly in the sixth.
Pakistan were 42-1 and Rashid then bagged a quick double as Sohaib Maqsood lofted the ball straight to Jason Roy for 67-2 and Mohammad Hafeez's high shot was easily plucked by Jonny Bairstow for 69-3.
His fourth wicket came in the 17th when Shadab Khan skied a shot to the leg side and was caught by Lancashire local Livingstone, leaving Rashid to complete his stint with figures of 4-35.
Moeen Ali had Fakhar (24) out lbw on review and shone in the evening sunshine with figures of 1-19 from his four overs and no boundaries conceded.
Imad Wasim was run out by Bairstow to leave Pakistan on 129-6, paying the price for a jog rather than a sprint.
England reached 60 without loss in reply but Buttler (21) swung high in the eighth, with Shadab bowling, and was caught by Babar as Pakistan breathed a sigh of relief.
Roy chalked up his half century in the 10th as England reached the half-way point at 83-1, compared to Pakistan's 73-3 at the same stage, but then it all went wobbly.
Bairstow went cheaply for five, caught by Maqsood, and England needed 51 from 40 balls with Ali coming to the crease before going for one, bowled clean through the middle stump by Hafeez.