Iwobi netted a late minute equaliser for Arsenal before they went ahead to win on penalties.
Reserve goalkeeper Emiliano Martinez was the unlikely hero for the Premier League side, saving Juan Bernat's soft spot kick after Arsenal substitute Alex Iwobi made it 1-1 right at the end of normal time.
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.
Robert Lewandowski needed just nine minutes to fire Bayern ahead from the penalty spot as the German champions dominated before Iwobi headed in at the death.
There will be no Champions League for Arsenal this term and a gulf in class was evident.
At one point in the opening period at Shanghai Stadium, where temperatures hovered around 36 degrees Celsius (97F), Wenger had his arms outstretched in frustration.
And at the end of a first half in which Bayern could have scored another five times but for goalkeeper Petr Cech, Arsenal playmaker Mesut Ozil booted the ball high into the air in anger.
The future of the German international, and that of Chilean star Alexis Sanchez, is in major doubt with both stalling over new contracts.
Sanchez is enjoying extra time off and is not in China after his involvement in the Confederations Cup.
But he may not have made a difference against Carlo Ancelotti's side, who took the lead after Ainsley Maitland-Niles had brought down Bernat in the box and Lewandowski did the rest.
Iwobi's injury-time leveller sent the game straight to penalties.
Both sides fielded a mixture of first-team regulars and reserves, with new Bayern signing James Rodriguez and new Arsenal striker Alexandre Lacazette starting.
Arsenal face Chelsea in Beijing in their next warm-up game at the weekend, while Bayern play AC Milan in Shenzhen, southern China.