Vedad Ibisevic gave Stuttgart the lead in the ninth minute and the 17-year-old Werner made it 2-0 just 83 seconds later.
Freiburg registered their goal in the 78th minute through Mike Hanke, but Werner struck again in the 82nd minute.
Stuttgart, who lost to Freiburg in the second round of the German Cup in late September, snapped a four-game winless streak to move up to eighth place.
Freiburg failed to build upon winning their first Bundesliga match of the season last weekend and remained winless at home. With just eight points,
Freiburg are 16th on the table.
Freiburg had the first chance of the game after seven minutes as Felix Klaus sent a through-ball to Admir Mehmedi, whose low shot was stopped by Stuttgart goalkeeper Sven Ulreich.
Stuttgart took the lead in the ninth minute as Christian Gentner crossed from the left side to the near post where Ibisevic poked home past Freiburg goalkeeper Oliver Baumann.
The visitors doubled the lead the next minute on a superb run by Werner, who got past two defenders on the left wing and then turned in and fought through another defender before beating Baumann.
Stuttgart nearly made it 3-0 after 13 minutes with Konstantin Rausch racing down the left side and crossing into the middle where Ibisevic hit the ball just wide.
Freiburg missed a scoring opportunity 11 minutes later with Mehmedi hitting Klaus' cross with his thigh just inches over the bar.
Stuttgart scored a third goal in the 31st minute but Alexandru Maxim was ruled offside.
Freiburg were close again just before the hour-mark but Ulreich slapped away Matthias Ginter's header off a Sebastian Kerk free-kick.
Freiburg pulled a goal back 12 minutes from time as Hanke scored from 10 yards out just over a minute after being subbed on.
Werner killed all Freiburg hopes in the 82nd minute with his second goal after collecting the ball near the middle line and then beating Baumann despite having two team-mates ready for a pass.