Thiago Alcantara struck twice and Arjen Robben, Robert Lewandowski and substitute Thomas Mueller were also on target as the Bavarians inflicted Arsenal's first defeat of the season in Europe's premier club competition.
Alexis Sanchez had equalised for the visitors, scoring on the rebound after Manuel Neuer saved his 30th-minute penalty but the Gunners suffered when captain Laurent Koscielny limped off injured to leave the defence exposed.
"We should score in London but it is a good starting position," said Bayern captain Philipp Lahm, who will miss the return leg through suspension. "It should be enough for us to go through.
"We played very good until the penalty and then the second half was sensational."
Robben said Bayern had proved their recovery from a recent dip in form.