Mubarak Wakaso's missed penalty meant Manfred Starke's lone goal made the difference in the warm-up game played behind closed doors in Dubai.
The match was the last opportunity for players to stake a claim to the final Afcon squad, which is expected to be named by Monday.
With the exception of captain Andre Ayew and veteran striker Asamoah Gyan, every member of Ghana's team had a run-out as two separate sides started the first and second halves.
Coach James Kwesi Appiah named 29 players for a three-week camp in the United Arab Emirates, but the team has been reduced to 28 players following the departure of St. Gallen defender Musah Nuhu due to injury.
The roster will be whittled down to 23 players for the June 21-July 19 championship, where the Black Stars have been drawn against Cameroon, Benin and Guinea-Bissau in the group stage.
Also preparing for the Afcon, where they have been pitted against Morocco, Cote d'Ivoire and South Africa in Group D, Namibia's win over Ghana is certainly a huge confidence-booster for the Brave Warriors.
Appiah's starting XI saw the return of Chelsea left-back Baba Rahman to national colours after a two-year absence, while Asante Kotoko's Abdul Safiu Fatawu was handed his debut, startin in midfield alongside Empoli's Afriyie Acquah.
Around the half-hour mark, Namibia broke the deadlock through Starke after goalkeeper Lawrence Ati-Zigi failed to hold on to a shot.
Ghana had a chance to draw level in the second-half but substitute Mubarak Wakaso's effort hit the woodwork, allowing the Warriors to hold on for a famous win.
The Black Stars will face South Africa in another friendly game on June 15 before departing for Egypt five days later.