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 line-up for the Black Stars.
Ghana will open World Cup Group G play on 16 June against USA. 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.
Korea Republic will try to bounce back from the drubbing in Brazil, with a Group H opener 17 June against Russia. The Koreans will also meet Algeria and Belgium in first-round matches.