SAN JOSE, Calif. -- Maybe a cross-country flight and a road game against one of the top teams in the league was all the Buffalo Sabres needed to get untracked.
Sabres center Cody Hodgson beat Sharks goaltender Antti Niemi in the fourth round of a shootout to give Buffalo a stunning 5-4 win over San Jose on Tuesday.
"Just 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," Sabres coach Ron Rolston said. "It's our obligation now to build on that as a team."
The Sharks (10-1-4) went past regulation for the third consecutive games, and they lost all three. An overtime loss and shootout setback to the division rival Los Angeles Kings and Phoenix Coyotes, respectively, preceded Tuesday's loss to a Buffalo team that is just 3-13-1 and was 0-6 against the Western Conference.
"We can't lose that game," Sharks center Logan Couture said. "We've got to find a way, we didn't play very well. That was obvious if you watched the game."
Couture was the lone Shark to beat Sabres goalie Ryan Miller in the shootout. Miller stopped center Joe Pavelski, center Patrick Marleau and left winger Tomas Hertl in succession. Niemi surrendered goals to left winger Matt Moulson and Hodgson.
Miller made 47 saves in regulation and overtime, while Niemi stopped 32 shots.
"I liked our effort tonight," Rolston said. "It goes back to execution and effort. If we can do that in 60-minute spans, we're going to win hockey games."
Buffalo jumped out to a 3-1 lead when right winger Tyler Ennis needed only 15 seconds to convert the Sabres' first power play of the game 80 seconds into the third period.
The Sharks struck back to tie it with goals 70 seconds apart. First, right winger Tyler Kennedy slipped a backhand shot past Miller at 3:19, then Hertl scored on a wraparound at 4:29 to make it 3-3.
Buffalo went ahead at the 7:28 mark when it scored a fourth goal in a game for the first time as defenseman Henrik Tallinder blasted a shot through Niemi.
"We gave up a couple of goals and were going down," Buffalo defenseman Rasmus Ristolainen said. "Then we got the lead back, and that helped us a lot."
The Sharks tied it again at 16:14, just three seconds after a fourth failed power play expired. Right winger Tommy Wingels dived into the crease to chip a loose puck into the open goal.
"The late push got us a point, but we've got to work on our shootouts," San Jose captain Joe Thornton said. "We're working hard. The game's 3-1 and you're thinking it's over, but we worked hard to get back into it."
San Jose's sloppiness early in the second period gift-wrapped a pair of goals for the Sabres, who took a 2-1 lead before the six-minute mark.
A defensive-zone turnover resulted in Buffalo right winger Drew Stafford shooting through Niemi's five-hole for his second goal of the season at 2:36. Niemi was victimized again between the pads at 5:53 when Buffalo center Cody McCormick fired a loose puck from the left circle after San Jose center Andrew Desjardins lost a defensive-zone draw to center Zemgus Girgensons.
The trend of success and failure in opening periods continued for the Shark and Sabres, respectively. San Jose scored the only goal of the opening session to improve its first-period goal superiority over opponents to 20-8, while Buffalo's first-period log fell to 21 goals allowed against only two scored.
San Jose right winger Marty Havlat scored his first of the year in his third game back from injury to cap a long cycle in the Buffalo end. Havlat's backhand shot in close slipped under Miller at 8:48 after the goalie stopped three shots during the hosts' extended stay in the offensive zone.
The goal snapped Miller's personal shutout streak of 139:22 against the Sharks, a stretch of scoreless hockey that included 88 consecutive saves.
"It was just a matter of sticking with it and getting the win," Buffalo left winger Marcus Foligno said.
Recent addition right winger Mike Brown didn't wait long to introduce himself to the home fans, engaging McCormick in a spirited fight 85 seconds after the opening faceoff.
NOTES: San Jose RW Brent Burns missed his seventh straight game due to facial injuries sustained Oct. 19, but he joined teammates for the first time during the morning skate. "I think that's a great step -- but I don't know if we're going to qualify it as little or big," Sharks coach Todd McLellan said. "But he's getting closer, feeling better and back out there with his teammates." ... Buffalo continues a quick three-game, all-California trip with stops in Los Angeles on Thursday and in Anaheim on Friday. ... The Sharks host the Vancouver Canucks on Thursday before heading out on a season-high, five-game road trip Nov. 10-17. ... The Sabres were without D Mike Weber (upper body) and LW John Scott (suspension) while C Mikhail Grigorenko and D Nikita Zadorov were healthy scratches. The Sharks have RW Raffi Torres (ACL surgery) and RW Adam Burish (back surgery) out indefinitely. San Jose LW James Sheppard and D Matt Irwin were healthy scratches, and RW Brent Burns sat due to an upper-body injury.