Dortmund had gone into the last game of the season in top spot but stumbled to a 2-2 against visitors Mainz 05, allowing Bayern to squeeze past them in the tightest league race in years.