Shortly after the cooling break, the Brazilian side pulled one back as Gerson fired a missile that went in off the underside of the bar, triggering a deafening roar from the crowd.
Bayern, however, restored their two-goal lead before the interval when Goretzka, capitalising on the space left by the Flamengo defence, whipped a shot from outside the box past keeper Agustin Rossi.
Tempers flared after a poor challenge by Pulgar on Kane as Flamengo struggled to contain their frustration.
Filipe Luis's side pulled one back again 10 minutes into the second half, Jorginho sending Neuer the wrong way after they were awarded a penalty for a Michael Olise handball.
The momentum had swung and Flamengo threatened with quick breaks, but Bayern held firm before finding the back of the net once more through Kane, who beat Rossi with another clinical low shot in the 73rd minute.
**Reuters**