The King Power Stadium outfit fought back from a goal deficit to grab maximum points in the five-goal thriller at St. James’ Park.
Mahrez drew the Foxes levelled sixteen minutes after Joselu had fired Rafael Benitez’s men ahead in the fourth minute.
The Algeria international was set up by Ndidi for his long-range strike to increase his tally to four goals in 16 league games this campaign.
Demarai Gray's effort in the 60th minute and an own goal from Ayoze Pérez in the 86th minute was enough for Claude Puel’s men to extend their unbeaten run in the Premier League to four games as Dwight Gayle’s 73rd-minute goal could not rescue Newcastle United from their fourth defeat in five league games.
Ghana’s Christian Atsu was introduced for Matt Ritchie in the 64th minute – his first game since the Magpies’ 1-0 defeat to Bournemouth on November 4 while Mahrez made way for Christian Fuchs in the 89th minute.
Nigeria international Kelechi Iheanacho watched the entire duration of the encounter from the bench.
The King Power Stadium outfit are placed eighth in the English Premier League log with 23 points from 16 games.
They travel to St. Mary’s Stadium to take on Southampton for their next league game on Wednesday.