Yet it was Bayern keeper Manuel Neuer who kept them in the game when he twice denied Youssef En-Nesyri with superb saves before Martinez benefited from being given too much space to head in on the rebound.
The Spaniards gradually ran out of steam, however, and it was only a matter of time until Bayern scored again.
Martinez, who is reportedly close to agreeing to a return to Athletic Bilbao this season, had come on five minutes earlier and benefited from being given too much space to head in on the rebound.
The Spaniard also scored in extra time in Bayern’s only previous Super Cup win in 2013.
Some 15,000 fans were seated in Budapest’s Puskas Arena with the game seen as a test event for the gradual return of fans to European games.
“We all know it is not easy to take right decision,” Flick said of allowing fans. “But it felt good to have an atmosphere in the stadium. It felt a bit more like football. I hope all the fans return home healthy.”
The match was held amid a growing second wave of COVID-19, with Hungarian cases at record highs, which had prompted warnings of the possible consequences of mass gatherings such as this game