Harnik's double enough for Stuttgart
Harnik scored in the 12th minute and Shinji Okazaki made it 2-0 for Stuttgart after 21 minutes. Freiburg pulled a goal back through Fallou Diagne in the 27th minute but Khalid Boulahrouz gave Stuttgart a 3-1 cushion after 63 minutes and Harnik struck for a second time in the 82nd minute.
Stuttgart had won just once in their last nine Bundesliga games but improved to 29 points. Freiburg remain on 18 points after just one victory in the last 11 league matches.
Stuttgart went ahead in the 12th minute with Gotoku Sakai passing to Harnik, who crossed paths with Vedad Ibisevic and turned toward the left, finding space to beat Freiburg goalkeeper Oliver Baumann.
Harnik set up Stuttgart's second goal after 20 minutes as the Austrian had a long run down the right side and crossed to Okazaki, who diverted the ball in from two yards out.
Freiburg pulled a goal back in the 27th minute as Erik Jendrisek's corner from the right reached the far post where Diagne headed in from eight yards. The visitors nearly equalised in the 48th minute as Cedric Makiadi crossed from the left side to the far post where Jan Rosenthal headed against the right-hand post from three yards.
Stuttgart re-established a two-goal advantage in the 63rd minute as Boulahrouz tried to duck out of the way of Ibisevic's header but the ball went off his neck and in.
Ibisevic missed a chance to decide the game for good in the 65th minute, heading wide from four yards out.
Harnik scored his second goal with eight minutes to go as Ibisevic headed forward to Tamas Hajnal, who then crossed to Harnik for an easy shot past Baumann.