Ghana dominated the game on a wet and steamy evening but Asamoah Gyan missed an eighth-minute penalty and Derek Boateng was sent off for a second bookable offence in the 84th minute.
Zambia reached the final for the first time since 1994 while Ghana, with a much stronger team on paper, extended a frustraing recent run at the tournament.
Despite boasting one of the continent's strongest teams and reaching the World Cup quarter-finals in 2010, the Black Stars also fell at the semi-final stage in 2008 and were runners-up two years ago. The last of their titles was back in 1982.
Mayuka, the only member of the Zambian squad playing for a European first division club, scored out of the blue with a superb shot on the turn in the 78th minute.
The Young Boys Berne striker had surprisingly been left on the bench by French coach Herve Renard as Zambia started with James Chamanga as their lone striker.
Ghana were gifted an early chance when Davies Nkausu was judged to have tripped Gyan in the area, although television replays suggested only the faintest of contact, if any, was made.
Gyan took the penalty himself but his weak effort was comfortably saved by Kennedy Mweene, diving low to his left.
Ghana missed another gilt-edged chance on the half-hour when a free-kick across the area found Jordan Ayew unmarked at the far post but he let the ball slip under his foot.
Zambia enjoyed a few periods of possession and Chris Katongo shot narrowly wide following a good run by Rainford Kalaba in their best chance of the half.
Ghana had another chance five minutes before the break when Kwadwo Asamoah worked an opening and shot wide narrowly wide from the edge of the penalty area.
In the second half Ghana take complete control although they still struggled to create clearcut chances.
Gyan threatened when he burst through the Zambia defence, only to shoot straight at Mweene. He was close again when a long cross hit him on the back of the head and bounced just wide.
Zambia scored against the run of play when half-time substitute Mayuka, 21, received the ball with his back to goal. He controlled it with his first touch then swung and sent a shot curling past Adam Kwarasey and in off the foot of the post for his third goal of the tournament.
Ghana pressed forward desperately but Zambia defended defiantly, their defenders repeatedly blocking goal-bound shots in an enthralling finale.
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.