AFCON 2015 Preview: South Africa v Ghana
The 1996 champions must overcome Avram Grant's men to have any chance of staying in the competition, but even then they require a favour from Senegal, who would need to beat Algeria in the other Group C match to ensure South Africa's progression.
"We are still in with a chance," Bafana Bafana coach Mashaba said after his side's 1-1 draw with Senegal.
"It was a good outing for us, we still have another game to play, don't overrule us, anything can happen. Football has its own miracles and I think our boys did very well in this tournament. With one game to go, we are still going to surprise a lot of people."
Captain Dean Furman was also keen to rally the troops ahead of South Africa's final pool match.
"We take a lot of confidence from the way we have played in these two matches, even if we have not got the results we hoped for," the midfielder said.
"We just have to hope that a win in our last game will be enough for us to go through."
Ghana have specialised in late drama in their first two games, though in the opening fixture against Senegal it was a script with an unhappy ending.
Senegal fell behind to Andre Ayew's early penalty, but Moussa Sow had the final word with a last-minute strike following Mame Biram Diouf's leveller.
Ghana, who have reached at least the semi-finals of the last four AFCON tournaments, delivered a late twist of their own last time out, as Asamoah Gyan scored a stoppage-time winner versus Algeria.
Speaking after that triumph, a relieved Grant warned his side that there was still work to be done.
The former Chelsea boss said: "Nothing has been decided yet in this group.
"Yes, we may have beaten the number one team in Africa, but we now face South Africa, who qualified for this tournament ahead of a big team like Nigeria.
"They played very well in their first game even though they eventually lost to Algeria. They are a fantastic team.
"We are a young team who have shown we do not give up and so we will come into any game to win it."
Watch every match of the Africa Cup of Nations LIVE on British Eurosport HD or sign up to Eurosport Player and follow the action on mobile, tablet and other devices: www.eurosportplayer.com