SAN JOSE, Calif. (AP) -- The Buffalo Sabres blew a pair of third-period leads and benefited from an apparent blown call in overtime before finally coming out on top in the shootout.
It's been that hard to get wins this season for Buffalo.
Cory Hodgson scored in the fourth round of the shootout and Ryan Miller made 47 saves to give the Sabres their third win in 17 games this season, 5-4 over the San Jose Sharks on Tuesday night.
''We just stuck with the game plan,'' defenseman forward Henrik Tallinder said. ''No matter what happened out there we said keep working hard, keep playing the way we want to play, and good things would come out of it and it did.''
They got a little luck in overtime. After Tyler Kennedy hit the post with a shot midway through the extra period, replays showed Tommy Wingels poked the loose puck under Miller's pad and over the goal line before Tyler Myers kicked it out.
''I knew I poked it,'' Wingels said. ''I didn't know where it went.''
Referee Mike Leggo ruled no goal, and the Sharks didn't argue the call. The play apparently was never reviewed by replay officials, and the game continued until the Sabres won in the shootout.
Matt Moulson and Logan Couture each scored in the first round of the shootout, and then Miller stopped three straight shots before Hodgson beat Niemi for the winner.
''To go on the road and play a team like San Jose and come in here and get two points is a big thing for us,'' coach Ron Rolston said. ''It's our obligation now to build on that as a team.''
Tallinder, Cody McCormick, Drew Stafford and Tyler Ennis scored for the Sabres, who have beaten the Sharks five straight times.
Kennedy and Tomas Hertl scored 70 seconds apart early in the third to erase a two-goal deficit for the Sharks. Wingels got another equalizer late in the third, but San Jose still lost its third straight game. Marty Havlat also scored and Antti Niemi made 32 saves.
''We can't lose that game,'' Couture said. ''We didn't play very well. We were sloppy with turnovers and sloppy on the power play. We didn't show up ready to play. We waited until the third period to show up and we got a point.''
The third period was filled with excitement with the teams combining for five goals starting when Ennis scored Buffalo's second road power-play goal of the season to make it 3-2.
But the Sharks erased that lead in a flash.
The first goal came when Joe Pavelski won a faceoff to Marc-Edouard Vlasic, whose shot deflected toward Kennedy, who knocked it in for his second goal of the season 3:19 into the period.
Then just over a minute later, Hertl took a rebound of Scott Hannan's shot and skated around the net for a wraparound goal that was his ninth of the season.
The Sabres appeared on their way to a rare win when Tallinder scored midway through the third and then they had a two-man advantage later in the period. But Jamie McBain hit the post during the 5-on-3, and the Sharks tied it late, shortly after a penalty to Marcus Foligno ended.
Wingels dove into the crease to knock in the loose puck to tie the game but the Sabres didn't fold.
''We stuck with it,'' Foligno said. ''This is a game that we had and we lost it a little bit and then we came back and they unfortunately got a goal. It's just all about rebounding and getting better every shift. Tonight was a great way to start the trip.''
What appeared to be a decided mismatch on paper between a Buffalo team that had one regulation win all season, and a San Jose team with just one regulation loss was anything but on ice. The Sabres overcame an early deficit and scored twice in the second period to take a 2-1 lead heading into the third.
Miller took over from there with stellar play on a pair of power plays late in the second. After Wingels hit the crossbar with a nifty shot from the side of the net, Miller got his pad on Justin Braun's rebound attempt to preserve the lead.
The Sharks predictably scored first with good pressure from Couture's line paying off with a goal midway through the first period when Havlat backhanded a loose puck in front of the net off Miller and in for his first goal of the season. That ended Miller's shutout streak against the Sharks at 139 minutes, 22 seconds and 88 straight saves.
It also marked the 15th time in 17 games that the Sabres allowed the first goal. They have been outscored 21-2 in the opening period this season, while the Sharks have outscored opponents 20-8.
NOTES: Miller tied Henrik Lundqvist for the most shootout wins in NHL history with 45. ... Tallinder has scored in consecutive games for the first time since January 2006.