Bayern were nearly heading to victory after taking a 1-0 lead from the penalty spot in the ninth minute through Robert Lewandowski, but were stunned by the Gunners.
James Rodriguez saw five chances at a first Bayern goal repelled by the veteran goalkeeper, whose efforts were rewarded in the 94th minute when Alex Iwobi headed home after a fine Arsenal move to equalise in normal time.
Nigeria worldwide, Alex Iwobi, was at the rescue as Arsenal beat Bayern Munich at the global Champions Cup in China on Wednesday.
Martinez dived to his left to deny Juan Bernat after also saving David Alaba's opening spot kick in the shootout, handing Arsenal an improbable victory despite being outplayed for much of a game that was played in sweltering heat.
In the 32nd minute, Ozil found Lacazette with a pinpoint through ball but his new £52million team-mate was brilliantly denied by Bayern goalkeeper Tom Starke.
Granit Xhaka also rushed back to deny James an open goal just before the break after a cut-back from Franck Ribery on the wing, while Cech made another low save from the Colombia worldwide just after the break.
"Personally I think James is a very good player who will improve our team quality and help us reach more goals", Muller said. "But maybe Bayern also dropped a bit".
The match ended 3-2 on penalties.
It may only have been a friendly and Arsenal emerged victorious, but it made for painful viewing at times for manager Arsene Wenger, whose side suffered a 10-2 aggregate drubbing to Bayern in last season's Champions League.
Arsenal face Chelsea in Beijing in their next warm-up game at the weekend, while Bayern play AC Milan in Shenzhen, southern China.