Freiburg started the contest brightly and could have been ahead in the 13th minute when Oliver Sorg unleashed a fine effort from long range but Manuel Neuer managed to keep the ball out.
Bayern settled well following a period of early pressure from the hosts and they managed to take a vital lead 12 minutes before the interval.
A deep cross was enough to beat Sorg, who found himself in a poor defensive position, and Xherdan Shaqiri controlled impressively before firing the ball into the back of the net.
Oliver Baumann frustrated Bayern after the break as the goalkeeper made two saves from a dangerous Shaqiri early in the second half.
Freiburg punished Pep Guardiola's side with four minutes remaining in the match when Sebastian Freis crossed for substitute Hofler, who showed great composure to volley past Neuer and snatch a point for his side.