Emanuel Pogatetz gave Nurnberg the lead against the run of player in the seventh minute before Pavel Krmas levelled. A penalty from Josip Drmic restored the hosts' lead at half-time, after Freiburg had hit the post twice.
But Admir Mehmedi brought Freibug level with a penalty eight minutes into the second half and Felix Klaus then sealed a deserved victory for Freiburg.
The result saw Christian Streich's side move three points clear of their opponents, who ended the game with 10 men after Pogatetz was dismissed.
Nurnberg stunned their hosts with a goal after only six minutes, Pogatetz heading in Hiroshi Kiyotake's cross at the near post before earning a yellow card for his excessive celebrations.
Freiburg reacted well and almost levelled just five minutes later when Mehmedi beat Raphael Schafer with his shot, but watched on as the ball struck the outside of the left-hand post.
Schafer was quick off his line to deny Karim Guede as Freiburg stepped up their search for an equaliser, finally earning their reward in the 23rd minute through Krmas, who headed in Jonathan Schmid's cross.
Freiburg nearly turned the game on its head just two minutes later when Schmid was faced with only Schafer to beat, but his shot hit the inside of the post and came back into Schafer's welcoming arms.
Streich's men appeared to be afflicted by the misfortune that has accompanied their opponents all season, in terms of hitting the woodwork - nobody in the Bundesliga has struck the framework as much as Nurnberg so far this season.
Things got even worse on the stroke of half-time when Pogatetz fouled Krmas inside the area and Drmic gave Nurnberg a half-time lead from the penalty spot.
Freiburg's luck turned in the second half, though, when Pogatetz fouled Klaus inside the penalty area and a spot-kick was awarded. Mehmedi sent Schafer the wrong way to bring Freiburg deservedly level.
More was to come for the hosts, who could finally feel things were turning their way, and they took the lead in the 65th minute.
Klaus received the ball from Marvin Plattenhardt's poor clearance and he directed his shot precisely into the top-left corner to give Freiburg the lead for the first time in the game.
It was a lead they were not going to relinquish, both for their own determination to win the game and for Nurnberg's inability and failure to mount a response.
To compound Nurnberg's woes, they lost Pogatetz to a second yellow card in the dying seconds of the game, when he was adjudged to have fouled Matthias Ginter.