Leicester won a third successive Premier League match as Ayoze Perez's own goal gave them victory in a thrilling encounter with Newcastle.
The Foxes made a terrible start as their hosts - roared on by a vocal home crowd following pre-game celebrations to mark the club's 125th anniversary - took the lead in the sixth minute courtesy of Joselu's close-range finish.
But the visitors rallied quickly and restored parity when Mikel Merino's loose pass gave them possession and began an attack that Mahrez ended with a superb 25-yard, left-footed drive into the top corner.
Demarai Gray put them in front via a deflection off Florian Lejeune but Gayle levelled matters with a shot that came off Harry Maguire.
Perez made his decisive contribution with four minutes to go, poking home in an attempt to prevent Shinji Okazaki scoring.
It was a deserved victory for Claude Puel's side, who have now earned 17 points from eight league games since Craig Shakespeare was sacked in October - a run of form that has taken them up to ninth.
Newcastle, meanwhile, have taken just one point from their past seven matches and the cushion between them and the relegation zone is just three points.