Equatorial Guinea midfielder Federico Bikoro was dismissed 10 minutes after the break for catching Bayo in the ribs with his studs.
The National Thunder were awarded a spot-kick midway through the second half after Sekou Sylla caught Iban Salvador, but captain Emilio Nsue hit the base of the right-hand upright.
And, with the game set to head to extra time, striker Bayo stooped to guide Ibrahim Diakite’s cross from the right flank just inside the near post in the final minute of added time.
The West Africans have made the last eight for the first time since 2015 and will take on DR Congo in Abidjan on Friday (20:00 GMT) after the Leopards beat record seven-time champions Egypt 8-7 on penalties following a 1-1 draw.
Guinea had barely made their one-man advantage count in the final 35 minutes, although goalkeeper Jesus Owono was forced to tip a header from striker Serhou Guirassy over the bar in the closing stages.
Yet Bayo’s dramatic late goal broke the resistance of the Equatoguineans and gave the Syli National their first triumph in seven knock-out stage appearances at the finals.
The Le Havre striker’s header, clocked at 97 minutes and 38 seconds, is the latest winning goal in a knockout match in the history of the Africa Cup of Nations.