Efe Ambrose handed the hosts the lead before the visitors produced an inspired turnaround to escape with maximum points, despite Salami's late strike
The hosts took a 13th-minute lead in Calabar through Efe Ambrose, only for Prince Oniangue to level the score.
Thievy Bifouma put the visitors ahead five minutes before half-time and the U.J Esuene Stadium was left shocked as the forward extended the advantage to 3-1 from the penalty spot.
Substitute Gbolahan Salami set up a grandstand finish with an 89th-minute goal, but Congo were able to hold on for a famous triumph.
Stephen Keshi's deal as Nigeria coach was allowed to run down after the 2014 World Cup, but the 52-year-old remains in charge and took the reins for Saturday's game.
Nigeria's last-16 defeat to France in Brazil was preceded by a dispute between the players and the country's football association over bonuses, and the ruling body are currently facing a possible ban due to political interference.
Congo lost to Rwanda in the previous round of qualifying and only reached this stage after their conquerors were found guilty of selecting an ineligible player.
They did not seem like such lucky losers when Ambrose nodded in from an Ahmed Musa free-kick but Oniangue restored parity on the end of a powerful run by Sagesse Babele.
Bifouma put his team ahead when Nigeria were hesitant in dealing with a corner and there was further defensive woe in the 53rd minute when Ogenyi Onazi felled the Almeria man and the referee awarded a penalty.
Bifouma made no mistake before Lazio's Onazi passed up a glorious opportunity to atone for his error at the other end.
Emmanuel Emenike, a surprise omission from Keshi's starting line-up, came on to draw a fine saw from Chancel Massa as Nigeria piled on the pressure.
Salami's strike in a goalmouth melee was their only reward and attentions can now only tentatively turn towards next week's match against South Africa, as a Fifa suspension hangs over the Nigerian FA unless it can agree to terms from world football's governing body by Monday.