Jesper Bratt scored from just outside the crease to pull the Devils within 5-3 at 10:15, and Zajac made it 5-4 with a one-timer from the left face-off circle at 15:53.
"That's one thing we have done well, we've battled to the end," Zajac said. "It's a good character to have in a group. Obviously, we'd like to be in control of games and in the lead and have those type of games, but it's not always that easy."
Zajac gave the Devils a 1-0 lead at 3:17 of the first period when he scored on a one-timer from the high slot.
Oshie tied it 1-1 at 9:16. After Ovechkin deflected Brenden Dillon's pass into the Devils zone, Oshie outraced defenseman Dmitry Kulikov to the puck and scored with a high backhand shot.
Conor Sheary's one-timer from the right circle deflected off Damon Severson and fluttered past Blackwood to give the Capitals a 2-1 lead at 3:21 of the second period.
Ovechkin made it 3-1 at 8:09 when he tucked in the rebound of Nicklas Backstrom's shot on the power play.
Yegor Sharangovich pulled the Devils within 3-2 with a wrist shot on the rush at 17:42, but Samsonov made a glove save against Severson at 18:19 to preserve the lead.
"They had plenty of chances to score, but I think 'Sammy' today was unstoppable," Ovechkin said. "Obviously, he gave us the victory. We respond when they score a goal. We kind of regroup and then get a lead 3-1, and then give them opportunity to come back to the game, but again Sammy was very good tonight."
The Devils outshot the Capitals 31-12 in the first and second periods.
"We had so many shots at the net and couldn't get them to go," Murray said. "We had some good chances, and then they had some chances and they capitalized on them. We liked the way that we played I think, but obviously those chances that we have, it's tough when they're not going in."
NOTES: Forward Kyle Palmieri was held out of the lineup for precautionary reasons, the Devils said. … It was Ovechkin's 115th three-point game in the NHL. … Zajac tied Bobby Holik for third place in Devils history with 202 goals, behind Patrik Elias (408) and John MacLean (347). … The Capitals went 7-0-0 against the New York Islanders in 1990-91. … The Capitals are 14-0-4 in one-goal games, the only team in the NHL without a regulation loss by one goal.