The visitors were left stunned early on when Hertha took a fourth-minute lead thanks to a composed finish from Maximilian Mittelstadt.
Bayern looked to end an inconsistent run of performances and the were level on seven minutes through Serge Gnabry, who finished off a move he instigated.
The former Arsenal man was denied a second following a good save from Rune Jarstein in the 26th minute, while Robert Lewandowski squandered a glorious opening in the latter stages of the half.
The second half resumed with no changes from dugout from any of the two suitors.
Four minutes into the second half, Bayern were in front for the first time as Gnabry completed his brace with a tidy finish.
The home side brought on Davie Selke an hour from the break and parity was instantly restored with his first touch from on 67 minutes.
Hertha nearly won it in the closing stages, but Luka Klunter did little to nothing at all to trouble Sven Ulreich in the box as the match went into extra time.
Eight minutes into extra-time, Kingsley Coman atoned for his earlier miss to head home from close-range.
Bayern had a couple more openings in the second half of extra-time, but they were unable to captilise as the encounter ended 3-2 in Berlin.