The crowd trouble came as their team's record uninterrupted top-flight run since the Bundesliga began in 1963 came to a controversial end.
Hamburg have been relegated for the first time in their history after 54 years in the Bundesliga.
Hamburg had battled to victory over Moenchengladbach, but were doomed to relegation as Wolfsburg beat Cologne 4-1. Their 16th-placed finish in the league puts them into the two-legged relegation playoff against Holsten Kiel, the first leg of which takes place next Thursday.
With Wolfsburg's win long-since confirmed, and no European places for Gladbach to play for, referee Felix Brych eventually restarted the game and then immediately blew for full-time, with Hamburg's teary-eyed players applauding their supporters on a lap of honour.
Lewis Holtby's curling strike kept Hamburg's hopes alive, but when Bobby Wood was sent off 20 minutes from time, their fate seemed sealed.
When news that the full-time whistle had blown in Wolfsburg filtered through, Hamburg fans invaded the pitch at the Volksparkstadion, igniting flares and forcing a lengthy suspension as order was restored.
Tassos Donis rocked Bayern again with a goal on the counter-attack before Chadrac Akolo and Ginczek struck to confirm the shock result.
Hoffenheim and Borussia Dortmund won the race for the remaining Champions League spots, even though the former club subjected the latter to a 3-1 defeat at the Rhein-Neckar-Arena.
Marco Reus equalised for Dortmund after half-time, but goals from Adam Szalai and Pavel Kaderabek fired Hoffenheim into Europe's elite.
A brace from Jean-Kevin Augustin and goals from Timo Werner, Dayot Upamecano and Ademola Lookman helped Leipzig to a frantic 5-2 win over Hertha Berlin.