Southampton's Mohammed Salisu and Bristol City's Antoine Semenyo scored second-half goals to secure the win.
Ghana, who have endured a poor run of results this year, will arrive in Qatar with fresh momentum.
The Black Stars have been drawn in Group H alongside Portugal, South Korea and Uruguay. They will kick off their campaign against the former European champions on Thursday.
Manager Otto Addo has called up a number of Premier League players for the tournament.
Salisu will be joined by Brighton's Tariq Lamptey, Leicester's Daniel Amartey, Crystal Palace's Jordan Ayew and Arsenal's Thomas Partey.
All those names, with the exception of Partey, took part in the friendly win over Switzerland.
While the result was certainly not ideal for the Swiss, Murat Yakin will be far more concerned with the performance. Despite fielding a strong side, Switzerland failed to land a single shot on target.
Manchester City's Manuel Akanji, Newcastle's Fabian Schar, Chelsea's Denis Zakaria and Arsenal captain Granit Xhaka all featured in the starting line-up.
Former Gunner Xherdan Shaqiri was also in the team as Switzerland slumped to their first defeat since June.
The European outfit have been drawn in Group G alongside Cameroon, Serbia and Brazil.