SAN JOSE, Calif. — A controversial non-call helped the Boston Bruins avoid what would have been a dispiriting loss. Then an unexpected source extended their winning streak.

Charlie McAvoy scored the game-winning goal in overtime and the Boston Bruins beat the San Jose Sharks 6-5 on Monday night in a game featuring two of the NHL's hottest teams.

McAvoy's fourth goal of the season came with 1:01 left in overtime.

After blowing an early three-goal lead, the Bruins trailed 5-4 with 1:49 left in the game when Chris Wagner tied it with his eighth goal of the season.

The Sharks said Wagner should have been called for high sticking in front of the net just before he slipped the puck past Sharks goalie Martin Jones.

"I think I got it shoulder length," Wagner said. "They didn't call a high stick so I knew it was good. It was a good break for us. It's pretty cool, we score six goals and we're on a roll."

The Bruins won their season-best sixth straight game and extended their point streak to 11 games (8-0-3).

"There were some funny goals and some lucky ones. In the end, let's take the two points," Bruins coach Bruce Cassidy said.

Boston moved three points ahead of Toronto for second place in the Atlantic Division.

"We saw the replay and it's just unfortunate the refs can't (review) it," Sharks centre Joe Thornton said of Wagner's goal. "Tough break, but definitely an entertaining game tonight."

The Sharks lost despite Thornton's fifth career hat trick.

San Jose had won seven of their previous eight games and 14 of 18 going into Monday. They fell out of a tie for first place with Calgary, which defeated Arizona.

Thornton's hat trick was his first since Oct. 27, 2010, against the New Jersey Devils. Thornton's first two hat tricks came when he was playing for Boston, the team with which he spent his first eight seasons.

"It was a spectacular night for him, considering it's his first NHL team, the history behind that," Sharks coach Peter DeBoer said. "Couldn't have written a better script other than winning the game."

Thornton's third goal and 13th of the season broke a 4-4 tie at 13:32 of the third period.

Tuukka Rask had 38 saves for Boston. The Bruins scored three goals in the span of less than five minutes to take a big early lead.

Torey Krug got the Bruins with a power play goal (his sixth) at 13:49 of the first period.

Zdeno Chara followed it with his fourth goal and rookie Karson Kuhlman scored his first career goal with 1:34 left in the period.

Jones had 20 saves.

"It was one of those games that went back and forth. Some missed calls, things happen that affect the game," Bruins forward Jake DeBrusk said. "It was big to come out on top of this one."

NOTES: DeBoer coached his 800th career NHL game. C Kuhlman played on the second line in place of Peter Cehlarik, who was injured in the third period of Saturday's game in Los Angeles. Cehlarik is day to day. Bruins F David Pastrnak (left thumb) missed his third straight game. ... Boston recalled D Steven Kampfer from his conditioning loan with the Providence Bruins. ... Sharks D's Erik Karlsson and Brent Burns were on the ice after missing a morning skate earlier in the day. ... The Sharks reassigned C Dylan Gambrell to the San Jose Barracuda.

UP NEXT

Bruins: At Vegas on Wednesday.

Sharks: At Pittsburgh on Thursday.

___

More AP NHL: www.apnews.com/NHL and www.twitter.com/AP_Sports