Joe Thornton scored two goals for the Sharks, who had eight wins in the 10 games since they lost to Detroit on Jan. 9.
Evgeni Nabokov gave up four goals on 37 shots in goal for San Jose. Detroit's Jimmy Howard made 32 saves.
Thornton scored both his goals in the first period to give San Jose a 2-0 lead. But Detroit came back with goals by Cleary with 5:08 to play in the period and Zetterberg with 1:02 to go.
After a scoreless second period, Detroit struck with two goals to take the lead. Meech knocked the puck off Nabokov's leg and into the net at 4:40 of the third period to break the tie. Eaves added the fourth goal at 8:58.