After losing 2-1 to the Foxes earlier in the campaign, it looked as if revenge was on the cards when strikes from Daniel Morris and Ronnie Fletcher sent the Hammers into an early lead but the visitors fought back with two late goals to earn a share of the points.
With just five minutes gone West Ham opened the scoring when Morris latched onto a through-ball from Collington and finished well.
Soon after, another Collington pass found Pearson, who should have shot first time but took too long and the ball rebounded to Tucker who fired wide.
In the 16th minute, though, the hosts extended their lead when Fletcher headed home from a Craig Saunders free-kick.
Leading up to half-time, Leicester created a couple of chances, with O'Grady firing over and Wright seeing his low effort being held by Sealey.
The Foxes stepped up their efforts early in the second half, creating several chances, but it was the Hammers who came closest to scoring when Saunders' delicate chip dropped just wide of the upright with the keeper stranded.
Sealey then misjudged an effort from Petrescu, whose effort bounced back into play of the bar, while Saunders was again unlucky when he cut inside on the edge of the area and curled his effort just wide.
In the 71st minute, Campbell pulled a goal back for the Foxes with a brilliant free-kick into the top left corner past the diving Sealey but West Ham nearly restored their two-goal advantage within minutes when a Saunders corner was met by Fletcher, whose header was tipped over by Logan.
In their search for an equaliser, Leicester then put the Hammers under severe pressure. In the final minutes, a Dodds effort hit crossbar, O'Grady saw his shot cleared of the line by Fletcher and Dodds again fired over before they finally got their reward when Petrescu fired his effort into the bottom corner past Sealey in the final minute.
Team: G. Sealey, Wright, Bunce, Parrington, Fletcher, Lumsden, Tucker, Collington, Morris, Pearson, Saunders. Subs Unused: Blewitt, Cohen, Laws, Lee, Noble.
Meanwhile, Tony Carr's under-19s continued their impressive run of results with a 4-1 victory at Leicester.
The Hammers were 2-0 up at half time with goals from James Allen and Anton Ferdinand. Leicester replied after the interval with a penalty, before Allen and Ferdinand both struck again to secure victory.