This emphatic victory follows their impressive 5-0 win over Chad just days prior.
Otto Addo's team, who arrived in Morocco on Saturday, managed to adapt swiftly despite limited preparation time.
They shifted from the successful 4-1-4-1 formation used against Chad to a 5-3-2 setup, introducing Jerome Opoku and Francis Abu into the starting lineup who replaced Inaki Williams and Ernest Nuamah.
The Black Stars began the match with vigour, nearly scoring early on from a Jordan Ayew free kick that found an outstretched Mohammed Salisu, who couldn’t get his effort on target.
However, it was Thomas Partey who broke the deadlock, connecting with Ayew's delivery from a similar spot to give Ghana the lead.
Despite this early success, Ghana struggled to maintain momentum as Madagascar gradually gained confidence, though they failed to pose a significant threat by halftime.
In the second half, Ghana regained their stride, doubling their lead through Partey once again, this time from an Ayew corner kick.
The game was sealed when Mohammed Kudus scored the third goal, ending a year-long drought with the national team.
Kudus' goal was beautifully set up by Ayew, who completed the night with a hat-trick of assists.
A flurry of changes from both sides was a signal of acceptance as the Black Stars strolled to the finish line to pick up crucial three points.
This win extends Ghana's lead at the top of Group I to five points, positioning them favourably for qualification with four matches remaining.
The Black Stars will next face Chad in September, aiming to secure their fifth World Cup appearance.
