Forward Obafemi Martins fired Nigeria ahead in the 20th minute at the UJ Esuene Stadium with a shot from the edge of the area.
The advantage was doubled before halftime when Martins pulled back a low cross for Michael Eneramo of Tunisian club Esperance to tap in.
Nigeria failed to add to its lead despite dominating the Group B match.
Goalkeeper Vincent Enyeama, who was one of few Nigerian players to impress at the World Cup, made a fingertip save with five minutes to go to keep Madagascar scoreless.
-The Canadian Press