Defenseman John Carlson gives Detroit’s Justin Abdelkader a taste of the glass in the second period Friday. (Carlos Osorio/Associated Press)

For 40 minutes, the Detroit Red Wings dictated the flow and pace Friday night. They buzzed in the Washington Capitals’ zone, converted a pair of power plays and carried a two-goal lead into the third period.

But for the second straight game, the Capitals engineered a third-period rally to snatch two points. Nicklas Backstrom scored the winner in the shootout at Joe Louis Arena to secure Washington’s 4-3 victory after Alex Ovechkin and Michael Latta scored in the final 20 minutes of regulation to force overtime.

The Capitals extended Detroit’s winless streak at home to seven, dating from Oct. 15, while continuing their own recent run of success. Washington improved to 6-1-1 in its past eight games.

“It’s a good sign that we battled back and good thing that we showed that character that we can come back,” Backstrom said. “You don’t want to stop playing after two periods even if you’re behind two goals. That’s something we talked about. We kept working, and we put pucks on net. Eventually we’re going to score, and that’s what we did.”

Washington had a key power-play opportunity at the start of the third but despite quality chances, including Backstrom in front and a whiff by Ovechkin, the Caps couldn’t convert. While the man advantage dried up — the Capitals went 0 for 4 in Detroit and are 0 for 11 in the past three games — the visitors found a renewed energy at even strength when Coach Adam Oates switched up the forward lines.

Oates decided before the period began that he would move Marcus Johansson up to his familiar spot as left wing on the top unit and slide Martin Erat to the second. The hunch paid off.

On the first shift after Johansson joined the first line, he set up Ovechkin’s goal that ignited the rally. The speedy forward eluded Pavel Datsyuk, carried the puck below the goal line and found Ovechkin low in the zone for a shot that knuckled its way over the shoulder of Detroit netminder Jimmy Howard (30 saves) to make it 3-2 with 3 minutes 19 seconds gone in the third.

“I was just looking for a spark as always. I actually thought Ovi was looking a little flat,” Oates said. “Teams have been taking him away on the PP, so I just tried to generate something. We got lucky with it, and the puck had eyes on his goal.”

In what was only a one-shift switch up on the third line later in the frame, Latta recorded his first career goal to tie the contest at 3 with 8:06 remaining in regulation. It was the result of a smart play by the gritty center, who drove to the net hoping for a loose puck knowing Howard likes to come out to challenge shooters. He got one when Howard didn’t control a rebound from John Carlson’s point shot.

“It was definitely nice to get it when it mattered so much, not a 7-0 game,” said Latta, 22. “He comes out and charges the puck a lot, so when [Joel Ward] put it back to the ‘D,’ I just thought get to the net and hope. It bounced right on my stick. I’ll take a lot of those.”

Long before the Capitals needed their third-period heroics, Brooks Laich recorded his first goal in 12 games to give them a 1-0 lead with 5:50 gone in the first. Michigan native Steve Oleksy picked off a Detroit clearing attempt as it crossed the red line and sent the puck back into the offensive zone, springing Laich on a breakaway. Howard made the initial stop, but the versatile forward swept his own rebound into the cage.

The Red Wings, eager to establish some positive momentum at home, fought to gain control, and before the period came to a close veteran winger Johan Franzen recorded two goals. Franzen evened the score on the power play, beating a screened Braden Holtby (34 saves) at 15:52. Then, with just 1:50 remaining in the first, Franzen struck again on a bad-angle shot from along the goal line to give Detroit a 2-1 lead.

Late in the second, a penalty to Tom Wilson for holding gave the Red Wings yet another opportunity, and Danny DeKeyser fired a one-timer from one knee to put them up 3-1 18 seconds before the second intermission.

DeKeyser’s tally marked just the second time all year that the Capitals, who owned the top-ranked penalty kill in the league heading into the contest, have allowed two power-play goals in a game.

But that deficit didn’t deter Washington as it entered the third ready to make a push for the second time this week. While mounting these late-game rallies isn’t an ideal situation, being able to pull it off may bring the Capitals a boost.

“You need to do that in order to gain confidence as a team and gain consistency. If you do it a couple times where you come back, then in the future you believe in yourselves a little bit more,” Holtby said. “It’s definitely a credit to our guys in being confident in our guys and [to] keep pushing.”

Capitals notes: Mike Green sat out with a lower-body contusion that he suffered in Washington’s 4-3 overtime win against the Columbus Blue Jackets on Tuesday.

More on the Capitals:

Capitals Insider: Latta records first NHL goal

Capitals Insider: McPhee not in favor of changing overtime significantly

Capitals Insider: Carlson finds a groove on offense