The South Americans got off to the perfect start as they went 2-0 up inside 10 minutes.
Firstly, midfielder Francielle fired a brilliant free-kick beyond Cameroon keeper Annette Ngo Ndom to give the Beijing 2008 silver medallists the lead.
Defender Costa then doubled the advantage as she rose powerfully to head home from Francielle's corner.
Ester came close to adding a third goal for the Samba Queens but her shot from distance was tipped away by Ngo Ndom.
Cameroon had barely registered as an attacking threat during the first half, but their brightest moment saw some excellent trickery from Gabrielle Onguene, only for the striker to fire her shot well wide.
Brazil's dominance continued after the break with Marta shooting wide after combining superbly with Thais Guedes.
But the captain did add a third from the penalty spot after 72 minutes, before substitute Cristiane calmly rounded the goalkeeper for the fourth.
Marta then rounded off the scoring by slotting into an empty net from Cristiane's pull back.