Aaron Hunt gave Bremen the lead after 16 minutes but Roman Neustadter equalised in the 59th minute and Julian Draxler scored the decisive goal 10 minutes later.
Just days after coming back from a two-goal deficit to draw 2-2 at home against Arsenal in the Champions League, Schalke again pulled something out of the bag to close the gap on Bayern to seven points.
Schalke's first chance came just 38 seconds into the match as Werder keeper Sebastian Mielitz made a superb save to keep out Klaas-Jan Huntelaar's back-heel attempt.
Werder took the lead with their first opening in the 16th minute. Huntelaar lost the ball in his own half and Eljero Elia passed to Zlatko Junuzovic, who in turn played in Hunt with the forward firing just inside the right post for his third goal in the last two matches.
The hosts came close to doubling their advantage on the half-hour mark as Sokratis' header crashed off the crossbar.
Bremen hit the bar again just two minutes later as Kevin De Bruyne's curling free-kick glanced off the framework.
The hosts equalised in the 59th minute from a set-piece, with Christian Fuchs' free-kick from the left finding Neustadter, whose header went over Sebastian Mielitz and in at the left post.
Schalke took the lead 10 minutes later, though, on a counter attack as Jermaine Jones passed to an on-rushing Draxler, who blasted his left-footed shot in at the far post.
Mielitz kept his team in the match with a superb stop from Draxler in the 84th minute and was lucky that Lewis Holtby was offside when he found the back of the net moments later.
Holtby then saved the day for Schalke four minutes into injury time, heading Theodor Gebre Selassie's effort off the line.