NEWARK, N.J. -- Dylan Strome scored two goals for the Washington Capitals, who defeated the New Jersey Devils 6-4 in a back-and-forth game at Prudential Center on Wednesday.

"Through a couple of games here, where we haven't been playing our best, we kind of carried the mistakes of a period into the next one, and it kind of compounds everything," Capitals forward T.J. Oshie said. "We learned from that and today we came out, just let it go, got back to our game, and it's a good win against a very good team."

Alex Ovechkin and Anthony Mantha each had a goal and an assist, and Evgeny Kuznetsov had two assists for the Capitals (2-3-1), who had lost three in a row. Hunter Shepard made 18 saves in his NHL debut.

"I don't think it's really sunk in yet," Shepard said. "I'm excited to get out there and see my parents because it's been a pretty emotional day. To have 13 or 14 people make it here on a day's notice from Minnesota, it's quite the support system."

Tyler Toffoli had two goals and an assist, Jack Hughes had three assists, and Timo Meier had a goal and an assist for the Devils (3-2-1). Akira Schmid allowed three goals on eight shots in the first period before being replaced by Vitek Vanecek, who made 14 saves.

"Our puck play was atrocious," New Jersey coach Lindy Ruff said. "We couldn't go tape to tape, and we were a soft team. I thought we got what we deserved tonight."

WSH@NJD: Strome doubles the lead while falling to the ice

Mantha scored his first goal of the season to give Washington a 1-0 lead at 6:37 of the first period.

Strome made it 2-0 at 15:52 on a shot from the slot while falling to the ice.

"A lot of good performances by Strome, Mantha. ... To get that goal early for him, it was a great play on the look-off shot, but Shepard, specifically, good for him," Washington coach Spencer Carbery said. "His first NHL start, probably not the way we wanted to draw it up in the second period, but that's a cool moment. He'll never forget that for the rest of his life.

"I'm sure family, friends, people in the building were happy to see him win his first NHL start."

Sonny Milano pushed it to 3-0 at 17:28 with a wrist shot from the left circle on a rush.

WSH@NJD: Devils combine for three quick goals to tie it

The Devils responded with four unanswered goals in a 6:30 span in the second period.

Toffoli made it 3-1 at 4:31, scoring from the bottom of the right circle after Meier's initial shot caromed to him.

Meier then pulled New Jersey to within 3-2 at 5:19, tapping in a backdoor pass from Hughes for his first goal of the season.

"It was a roller-coaster game, but you have to earn momentum back, and we didn't do a good enough job," Meier said. "We just let that momentum swing get away from us."

Nico Hischier tied it 3-3 at 6:42, absorbing a check from Tom Wilson in order to score from near the left post.

Toffoli put New Jersey in front 4-3 at 10:01 of the second, but Strome answered back with a power-play goal 18 seconds into the third period to tie it 4-4.

"Our power play stepped up right out of the gate to sort of set the tone for the third period, and then I thought for the first half of the third we were on it," Carbery said. "Then we did enough good things in the final 10 minutes to hang on. We made smart decisions, smart reads, and smart puck plays to keep everything to the perimeter."

WSH@NJD: McMichael puts a backhand into the net for the lead

Connor McMichael put Washington back in front 5-4 with a backhand in front off a 2-on-1 at 2:09.

Ovechkin scored into an empty net 18:25 for the 6-4 final.

"The message after the second period was really simple, actually," Oshie said. "It was more of a question from the bench boss if we wanted to play like the first period or the second period. So we kind of shook that second period off, which is a good sign."

NOTES: Ovechkin scored his 824th NHL goal, 70 away from tying Wayne Gretzky for the most in NHL history. ... Shepard became the fourth Capitals goalie in the past 10 years to win his NHL debut. Ilya Samsonov (Oct. 4, 2019), Vanecek (Jan. 15, 2021), and Zach Fucale (Nov. 11, 2021) were the other three. ... Toffoli has scored six goals this season, each of which has come in the past three games. ... Hughes has 17 points (four goals, 13 assists) in six games. He is the 10th player in NHL history to record at least that many through the first six games, and the first to do so since Mario Lemieux (six goals, 11 assists) in 1995-96.