Once again shorn of talisman Pierre-Emerick Aubameyang, who missed out because of "cardiac lesions" after contracting COVID-19 last week, the Panthers fought back on Saturday (AEDT).
Andre Ayew had lashed four-time AFCON champion Ghana ahead in the 18th minute with a powerful shot on the turn from just outside Gabon's area.
It was a brilliant effort from the Black Stars' captain, the venom on his shot getting the better of Gabon goalkeeper Jean Noel Amonome.
But that was the only attempt Ghana managed to get on target and it was made to pay late on when a quick free-kick caught its defence cold, with substitute Allevinah drilling in a low finish.
Ayew's angry reaction at full-time resulted in a fracas on the pitch, with the referee then showing a post-match red card to Ghana's Benjamin Tetteh, who punched a Gabon player in the face before seemingly fleeing the scene.
Gabon is on four points in Group C, with leader Morocco now through.
Ghana, meanwhile, must beat Comoros next Wednesday (AEDT) to stand any chance of progressing.