Portsmouth 2 Wigan Athletic 1
Wigan looked to be heading for a deserved replay after Lee McCulloch had driven home a spectacular equaliser with seven minutes remaining.
But then after many of the 14,336 crowd - Portsmouth's lowest of the season - had headed home, Kanu scored his 10th of the season.
Glen Johnson, as he had done with the first, set up the second with a right-wing cross and Kanu was unmarked as he headed home from six yards.
Wigan, depleted by injuries and with two Scandinavian newcomers, were in danger of being swamped in the driving rain during the first 25 minutes as Portsmouth spurned chance after chance.
Benjani Mwaruwari should have scored in the 13th minute after going around the advancing goalkeeper Mike Pollitt, but his goal-bound shot was cleared from near the line by the outstretched leg of Swedish loan signing Andreas Granqvist.
Pollitt made up for his rashness by making a smart save diving to his left to keep out a shot from Andy Cole and then clutched a low free-kick from Niko Kranjcar.
Kranjcar also went close with a header in the 16th minute but Wigan held on and grew in confidence despite the absence of five injured players.
Emile Heskey headed narrowly over and was then deprived of a shooting chance by a superb tackle from the ever-alert Sol Campbell.
But after 64 minutes Pompey went ahead when Cole got on the end of a centre from Johnson and turned sharply on to his left foot, before shooting into the roof of the net for his fourth of the season.
The Latics refused to surrender and it needed a typically athletic save from David James, leaping two-handed to his right to hold on to a 35-yard shot from Leighton Baines.
Wigan still appeared destined for defeat until they equalised in the 83rd minute after their substitute Gary Teale broke down the right and centred for McCulloch to blast home a right-foot shot with the keeper unable to move.
Wigan had defender Fitz Hall booked for a foul and Portsmouth twice came close to scoring when Pollitt raced from his goal to block a shot from Sean Davis and from the follow-up Gary O'Neil had a shot cleared unwittingly from near the line by Hall.
Then came Kanu's winner after the fourth official had indicated three minutes of time being added on. Two minutes of those had gone when Johnson crossed and Kanu had a free header for his goal.
There was still time for Baines to try his luck from long range again, but James was able to watch his 30-yard effort sail narrowly over the bar as Pompey held on for a place in the fourth round.