Iheanacho was given the nod to spearhead Leicester attack, after first choice striker Jamie Vardy was excused following the birth of his daughter on Saturday.
His Eagles teammate Wilfred Ndidi started from the bench and was brought on in the 70th minute, for his 19th league appearance.
It was a return to winning ways for Leicester after suffering back-to-back defeats to Manchester City and Liverpool.
With five minutes remaining in the first half, Iheanacho gave Leicester the lead after heading in Ayoze Perez’s knockdown.
On the stroke of half-time West Ham equalised thanks to Pablo Fornals who finished off Anderson’s pass.
And in the 56th minute, Demarai Gray scored the winning goal after he was played through on goal by Perez.
Leicester should have taken the lead in the 12th minute from the penalty spot after Lukasz Fabianski fouled Iheanacho, but Gray saw his effort saved by the Polish keeper.
The win took Leicester back to second on 42 points, 10 points behind leaders Liverpool in the league table, while West Ham have 19 points in 17th position, a point above the drop zone.
The game was Iheanacho’s fourth appearance in the league with three goals.
And at Carrow Road, Tottenham Hotspur missed the chance to go fourth as they had to come from behind twice to draw 2-2 against Norwich City.
Norwich took the lead in the 18th minute before Christian Eriksen drew Spurs level on 55 minutes.
An own goal by Serge Aurier in the 61st minute saw Norwich go 2-1 but Harry Kane’s 83rd minute penalty, salvaged a point for Spurs.
The draw means Spurs stay fifth on 30 points and Norwich are rock bottom on 13 points.
In the earlier games played on Saturday, Brighton and Hove Albion, who are yet again without Leon Balogun, beat Bournemouth 2-0, Newcastle United lost 2-1 to visiting Everton, Southampton were held to a 1-1 draw at home by Crystal Palace and 10-man Watford beat Aston Villa 3-0 at Vicarage Road.