Stefan Schimmer scored a dramatic stoppage-time winner as Heidenheim boosted their survival hopes with a come-from-behind 2-1 victory over Freiburg.