Patrick Marleau scored twice and Antti Niemi made 30 saves to help the San Jose Sharks top the Detroit Red Wings 6-4 on Thursday night.

Marc-Edouard Vlasic, Matt Nieto, Chris Tierney and Logan Couture also had goals for San Jose, which ended a two-game skid.

Detroit got goals from Tomas Jurco, Tomas Tatar, Stephen Weiss and Justin Abdelkader as it dropped its second straight at home. Jimmy Howard made seven saves, but allowed three goals in the first before being pulled for backup Petr Mrazek.

The Sharks got the game's first goal 19 seconds in after Melker Karlsson stole the puck deep in the Detroit zone and got it to Vlasic, who beat Howard with a one-timer from just inside the blue line.

Nieto made it a two-goal lead midway through the period when his shot nicked the right goal post before going in — but the advantage lasted just 40 seconds. Jurco knocked the puck home on his third swipe in front of Niemi to cut the deficit at the 10:04 mark and Tatar tied it a few minutes later when he redirected Danny DeKeyser's shot past the Sharks goalie.

Tierney gave the Sharks the lead for good late in the period with a wrap-around past Howard, who surrendered three goals on the first nine shots he faced on his 31st birthday.

After a scoreless second, the teams took turns scoring in the third. Couture scored 31 seconds into the period after his wrist shot banked in off a post and Weiss added a rebound goal three minutes later. Marleau's wrist shot made it a 5-3 lead at 4:56 of the period, but Abdelkader cut the advantage to a goal a few minutes later with a rebound marker of his own.

The Red Wings had a power play midway through the third, but could not manage a shot on Niemi.

Marleau closed the scoring with an empty-net goal. The Red Wings, seeking to hold off surging Ottawa for third place in the Atlantic Division, heard a smattering of boos from the fans who stuck around for the final horn.

San Jose's Joe Pavelski found a clever way to lose his stick late in the first while battling for the puck in a corner. He extended his arm and the blade wedged between Luke Glendening's visor and helmet. No penalty was called and the Detroit forward skated into a TV timeout with the stick stuck in his helmet.

NOTES: Detroit forward Pavel Datsyuk missed his fifth straight game with an undisclosed lower-body injury, while fellow forward Erik Cole was scratched with an upper-body injury. ... San Jose signed University of Wisconsin goalie Joel Rumpel to a standard one-year entry level contract and assigned him to Worcester of the AHL. ... Red Wings defenseman Niklas Kronwal returned to the lineup after missing Tuesday's loss to Arizona with a lower-body injury.