The hosts got off to a promising start when Dwight Gayle’s cut-back was converted by Joselu after four minutes.
Leicester levelled in style when Riyad Mahrez unleashed a fierce drive past Karl Darlow.
The Foxes took the lead on the hour when Demarai Gray’s strike flew in off Florian Lejeune.
Newcastle equalised on 73 minutes, Gayle turning neatly to fire past Kasper Schmeichel.
But with only four minutes left substitute Perez put the ball past Darlow in an attempt to cut out Jamie Vardy’s pass for Shinji Okazaki.
Leicester’s win takes them eighth, while Newcastle’s sixth defeat in seven leaves them 16th.
Newcastle: 13 Dec v Everton (H)
Leicester: 13 Dec v Southampton (A)