Ayew opened the scoring in the 11th minute, followed with another goal in the 53rd minute and completed the hat trick in the 89th minute.
Gyan, the former Sunderland striker, scored in the 44th minute. He had been among reserves earlier in Ghana’s World Cup tune-ups but was among 10 players moved into the starting lineup for the Black Stars.
Ghana will open World Cup Group G play on June 16 against the United States. The Black Stars knocked the Americans out of the World Cup in the round of 16 in 2010 at South Africa and with a group-stage victory over them in 2006 at Germany.
Ghana will also face Germany in Portugal in other Group G matches at Brazil.
South Korea will try to bounce back from the drubbing in Brazil, with a Group H opener June 17 against Russia. The Koreans will also meet Algeria and Belgium in first-round matches.