This was the German champions’ second defeat in 10 Bundesliga games this season.
Kovac leaves with Bayern fourth in the table, four points behind leaders Borussia Monchengladbach.
The 48-year-old former Eintracht Frankfurt boss had been in charge since July 2018 and led Bayern to a league-and-cup double last season.
Kovac won 45 of his 65 games in charge of Bayern but Saturday’s defeat was the club’s heaviest in the Bundesliga in 10 years.
Bayern said in a statement the decision had come as “result of a mutual discussion with Niko Kovac on Sunday.”