CHICAGO (AP) — The San Jose Sharks rebounded after blowing yet another lead.

Joe Thornton broke a tie on a deflection at 7:13 of the third period and San Jose beat the Chicago Blackhawks 5-3 on Thursday night to snap a two-game losing streak.

READ MORE: Penngrove Home Inferno Forces Evacuations North of Petaluma

Thornton, parked in front of the crease, redirected Marc-Edouard Vlasic’s shot from the left point past Marty Turco 7 seconds after a San Jose power-play ended.

The goal restored the Sharks’ lead at 4-3. They had lost a 3-1 advantage in the final minute of the second period when Chicago’s Troy Brouwer and Brian Campbell scored 22 seconds apart.

San Jose bounced back and played solidly in the third, however.

“We were pretty positive,” Thornton said. “It’s a 3-3 game. We’re in Chicago with 20 minutes to win the game. “It was pretty upbeat (in the dressing room) and I think that’s probably why we won this game.”

Ryane Clowe’s empty-net goal with 48 seconds left sealed the victory.

San Jose lost 5-3 in Minnesota on Wednesday night despite leading 3-2 after two periods. On Thursday, the Sharks avoided a repeat outcome.

“I think we all left the bench extremely frustrated (after the second period),” San Jose coach Todd McLellan said. “We couldn’t enter the third playing that way, so we talked about it.

“We mentioned the players were getting tested for whatever reason. We needed to man up and get out there and try to find a way to overcome it.”

Scott Nichol, Benn Ferriero and Dany Heatley also scored for the Sharks.

San Jose goalie Antti Niemi made 26 saves in his first appearance at the United Center since backstopping the Blackhawks to the Stanley Cup last spring. He improved to 3-0 against his former club, and the Sharks won their third straight against Chicago, which had swept them from the Western Conference finals last spring.

READ MORE: KNP Complex Fire: Sequoia National Park's Giant Forest Unscathed

“Whether it’s revenge or not, this is a good team and we know each and every time we have to play our top game to beat them,” Heatley said. “We were prepared tonight.

Patrick Sharp also scored for Chicago, which lost it second straight despite the quick second-period comeback.

It was an OK game, but it’s disappointing,” Blackhawks coach Joel Quenneville said. “Our recent losses, the third period we’re tied and we’re looking like we’re getting something out of the game and we come up with air.

“If we want to become a playoff team and a better team, these are the points we have to have.”

Turco made his third straight start, stopping 20 shots.

Blackhawks captain Jonathan Toews sat out his first game because of a right shoulder injury, sustained in a 3-1 loss at St. Louis on Tuesday night. He’s expected to miss at least two weeks.

Sharp opened the scoring with a power-play goal with 4:16 left in the first. He connected from the left edge of the crease after taking a feed from Tomas Kopecky behind the net to cap nearly a minute of crisp Chicago passing and puck possession. Nichol tied it with 1:06 left in the period when his drive from right wing trickled past Turco after hitting his blocker.

Ferriero’s 5-on-3 power-play goal at 1:46 of the second put the Sharks ahead. He scored into an empty net from the left edge of the crease after Logan Couture faked Turco to the ice.

Heatley extended San Jose’s lead to 3-1 with another power-play goal with 6:14 left in the second. Turco made a pad save on Jason Demers’ drive from the left circle, but Heatley got behind Chicago defenseman Niklas Hjalmarsson and fired in the rebound.

Brouwer cut it to 3-2 with 23 seconds left in the period with a fluke power-play goal when his shot from the right corner deflected in off the heel of Niemi’s stick. Campbell pinched in from the point and tied it with a second remaining after taking Dave Bolland’s feed from behind the net.

MORE NEWS: Man Charged With Attempted Murder After Woman Repeatedly Ran Over By SUV At Millbrae Starbucks

(© CBS Broadcasting Inc. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed. The Associated Press contributed to this report)