Joonas Donskoi, Kevin Labanc and Timo Meier also scored to help the Sharks win for the fourth time on the homestand and remain in second place in the Pacific Division. Chris Tierney added an empty-net goal to seal it.
Martin Jones made 23 saves for San Jose.
Fehr gave the Sharks the lead for good during a long delayed penalty in the first period. With San Jose having the extra attacker, Fehr got in front of the net where he deflected Brenden Dillon’s point shot past Howard for his first goal in eight games with the Sharks since being acquired from Toronto last month.
The Sharks made it 3-1 early in the second when Labanc poked in a rebound after Howard stopped Chris Tierney on a breakaway.
The Red Wings made it a one-goal game later in the second when Tyler Bertuzzi appeared to deflect the puck with a high stick off the post and Nyquist knocked it in off the goal line.
Detroit appeared to get the equalizer on the power play later in the second but Anthony Mantha’s goal was immediately waved off because he redirected it into the net with his skate.
The teams then traded goals early in the third, with Meier scoring on the power play when he deflected a shot from Mikkel Boedker and Zetterberg answering for Detroit off a nice pass from Nyquist.
The Sharks looked flat at the start in a game that meant much more to them than the Red Wings, who are 15 points out of playoff position. But Detroit took seven of the first eight shots on goal and led 1-0 after Daley took a pass from Zetterberg in the slot and beat Jones.
The momentum shifted after San Jose killed a penalty and the Sharks took the lead with a pair in a span of less than two minutes. The first came off the rush when Evander Kane took a cross-ice pass from Joe Pavelski and slid it back across the crease to Donskoi, who tapped it into the open net for his 14th goal.
Fehr added his goal 1:44 later for his first since Jan. 18, 2017, for Pittsburgh against Montreal.
NOTES: Bertuzzi had three assists. … Zetterberg took over sole possession of fifth place in goals for the Red Wings with his 336th, breaking a tie with Ted Lindsay. … The Sharks allowed the first goal in five of six games on the homestand.
Red Wings: Visit the Los Angeles Kings on Thursday.
Sharks: Visit the Edmonton Oilers on Wednesday.