Victory gave World Cup hosts and favourites England an unbeatable 3-0 lead in the five-match series.
England were cruising to a victory target of 341 at 201 for one when Jason Roy's dismissal for 114 sparked a collapse that saw three wickets lost for seven runs in 10 balls.
But Ben Stokes's 71 not out saw England home with three balls to spare after Babar Azam made 115 in Pakistan's 340 for seven.
The series concludes at Headingley on Sunday.
Series: England lead five-match series 3-0 (1st ODI was a no-result due to rain).
(This story has not been edited by Business Standard staff and is auto-generated from a syndicated feed.)