Portsmouth piled on the agony for West Ham as Kanu's sixth goal in seven games and a late strike by Andy Cole subjected Alan Pardew's team to a sixth consecutive defeat.
Veteran striker Cole's goal, the day before his 35th birthday, made the points safe as he spun on a fine cross by fellow substitute Lomana LuaLua to drill past Roy Carroll for his first Pompey goal just six minutes after coming on for Benjani Mwaruwari.
Pardew sent out a side shorn of injured Argentinian striker Carlos Tevez, while compatriot Javier Mascherano sat on the bench until the last few minutes.
It was Kanu who had Hammers reeling with a 24th minute strike, his sixth of the season, in a passionate game which produced eight bookings by referee Graham Poll — four for each side.
It was a former West Ham man, Glen Johnson, who had the first shot for Portsmouth, set up by Gary O'Neil.
The full back, on loan from Chelsea, ended a determined run with a shot from 20 yards which went just wide.
Paul Konchesky tried his luck from 30 yards after a throw by fellow full-back Jon Spector in the ninth minute — but his drive was well off target.
James had to move smartly to come off his line and grab the ball at the feet of Bobby Zamora after Sheringham's cross two minutes later.
But within a minute Pedro Mendes had released a trademark 30-yard blast at the other end which took a deflection wide.
O'Neil and Nigel Reo-Coker both appeared to be harshly booked by Poll, as the rhythm of a game which flowed with competitiveness and skill was interrupted.
But West Ham left a gaping gap in defence when Kanu rose virtually unchallenged to head home the game's opening goal from Johnson's cross in the 24th minute.
The visitors were left complaining about the Nigerian holding down Anton Ferdinand as he delivered his close-range strike — but they should have looked instead at their shoddy defending.
Twice more they left big holes for Kanu before the break — and he really should have added a second goal six minutes after the first instead of slicing wide left-footed after O'Neil set him up.
Four minutes later the former Arsenal, Inter Milan and Ajax ace was again horribly off target after Benjani supplied the service.
West Ham had plenty of possession in the first half and their fighting spirit also earned bookings for captain Matthew Etherington and Sheringham — who steered a back-flick just wide in their best scoring opportunity before the break.
Manuel Fernandes, making his first Premiership start in an all-Portuguese midfield with Mendes, almost doubled Pompey's lead early in the second half when he finished a fine move by shooting just wide.
And Sol Campbell's header plus Mendes' follow-up shot also tested the visitors after Kanu volleyed powerfully over.
Hayden Mullins hit the outside of a post, clipping a shot off James' body, before the former England goalkeeper got down well to hold Konchesky's long-range drive.
But Cole secured a much-deserved victory for the home side in the 82nd minute.