Needing a win, in extra-time or normal-time, the hosts threw away their initial lead in a contest that saw the opening four goals come in the space of two third-period minutes.
In an end-to-end opening period, Nigeria were largely on top as they sought to tie up their spot in the semi-finals, although goalkeeper Adeji in the Ghana goal proved up to the task early on.
At the other end, Ayalogu pulled off a wonderful double save to keep the score level before Abu struck the Ghanian upright.
With the goalkeepers impressing ahead of their outfield colleagues, the sides went into the final frame goalless amid high tension in Lagos.
The breakthrough eventually came when Emeka sidefooted a volley into the top corner, although the wild scenes in the stands at Eko Atlantic City were shortlived as Husseini also found the roof of the net shortly after.
Ghanaian forward Adjei completed the turnaround when he swivelled and shot low past Ayalogu but Emeka levelled for Nigeria as the game came to life.
Obodo’s penalty briefly put Nigeria back in front and, after Osa levelled from the restart, Tale collected Abu’s pass to rifle the winner home with less than two minutes left on the clock.
Goals: 1-0: Emeka, min. 8 (3); 1-1: Husseini, min. 8 (3); 1-2: Adjei, min. 7 (3); 2-2: Emeka, min. 7 (3); 3-2: Obodo, min. 3 (3); 3-3: Osa, min. 3 (3); 4-3: Tale, min. 1 (3)
CAF Beach Soccer Africa Cup of Nations 2016
Thursday, 15th December 2016
16.15 - Libya 2-10 Senegal
17.30 - Egypt 4-2 Ivory Coast
18.45 - Madagascar 1-2 Morocco
20.00 - Nigeria 4-3 Ghana
Saturday, 17th December 2016
16.15 - Libya v Ivory Coast
17.30 - Madagascar v Ghana
18.45 - Senegal v Egypt
20.00 - Morocco v Nigeria