Brazil had the better of the chances, but Peru actually had more of the possession with neither team scoring for the remainder of the half as the Selecao took a 1-0 lead into break.
Neymar, who was largely anonymous in the opening 60 minutes, looked to have won a penalty just after the hour mark, but after a VAR check the referee rightly overturned the decision.
The goal was Neymar's fifth in his last five games in international competition and moved him within nine of tying Pele's all-time scoring record for Brazil.
However, minutes later, the Paris Saint-Germain star found the back of the net with a quick turn and shot from outside the penalty area to beat Gallese and double Brazil's lead.
A vintage Brazil passing sequence led to Brazil's third, with Everton Ribeiro slotting home from close range from a perfectly weighted Richarlison cross to put the three points in the bag.
To add further gloss to the scoreline, Richarlison scored one more for Brazil, shooting past Gallese while lying on the ground after the Peru keeper had saved his first effort.
Brazil, who lead their group with six points, play second-placed Colombia next on June 23 and finish out their campaign against Ecuador four days later with four of the five teams in each group advancing to the knockout rounds.