DETROIT -

Patrick Marleau scored the winner in the shootout and had a short-handed goal early in the game, lifting the San Jose Sharks to a 3-2 win over the Detroit Red Wings on Thursday night.

Antti Niemi made 27 saves through overtime, while Jimmy Howard stopped 28 shots for Detroit. Niemi got his glove on Niklas Kronwall's slap shot with 44 seconds left in the extra period, giving the Sharks a chance in the shootout.

San Jose, trying to earn home-ice advantage in the first round of the playoffs, is in fourth place in the Western Conference, one point ahead of St. Louis and Los Angeles.

The Red Wings, clinging to the eighth and final playoff spot in the West, are hoping to extend the franchise's streak of consecutive postseason appearances to 22 but have lost five of their last seven games.

The Sharks and Red Wings are the only teams who have been in the playoffs every season since the 2004-05 lockout.

San Jose had lost two straight, including a 4-0 setback at Columbus, after a seven-game winning streak.

Pavel Datsyuk scored for Detroit on a backhander to start the shootout before Logan Couture slipped a shot between Niemi's pads. Damien Brunner then was stopped by Niemi and Joe Pavelski got a shot past Howard, but hit the post. Detroit's Gustav Nyquist made a nifty spin move but was stopped, and Marleau followed with the winner on a quick wrist shot.

Marleau had a short-handed goal to put San Jose ahead 2:35 into the game. Detroit's Justin Abdelkader tied it midway through the second period.

The Red Wings took their first lead early in the third on Jakub Kindl's first power-play goal and quickly lost it. Couture scored 1:31 later on a power play to make it 2-all.

The Red Wings start a four-game road trip Friday night at Chicago and return home to play three of their last four games of the regular season.

San Jose's road trip continues Saturday at Dallas and Phoenix before finishing the regular season with four of six games at home.

Detroit had a shot to get off to a good start when San Jose's Tommy Wingels was called for boarding less than a minute into the game, but the Sharks took advantage of a giveaway.

Henrik Zetterberg passed instead of shooting into a partially open net, Pavelski got in front of it, carried the puck deep into the Detroit on a 2-on-1 rush and perfectly set up Marleau for his team-high 17th goal.

San Jose outshot the Red Wings 11-5 in the first period in which they were held without a shot for nearly the first 8 minutes of the game.

Niemi made a key save from his left hip in the second period, getting enough of his glove on Cory Emmerton's shot -- just outside of the goal line -- to let San Jose keep its lead.

The Red Wings kept the pressure on San Jose and it paid off. Johan Franzen had the puck behind the net and passed to Abdelkader, who scored on a one-timer from the bottom of the right circle to match his career high with an eighth goal and suddenly Detroit was outshooting the Sharks 16-14.

San Jose couldn't clear the puck early in the third, allowing Zetterberg to make up for his mistake early in the game by making a centering pass on Kindl's go-ahead goal at the 2:29 mark. A little more than a minute later, Red Wings rookie Brendan Smith was called for holding and Couture took advantage of having extra space and an extra skater by tying the off a rebound.