NEW YORK — Before Friday night, with a month of baseball down, the Washington Nationals were perhaps the last team to choose in a home run-hitting contest. That logic cut both ways. Their pitchers had allowed homers at a higher rate than any staff in the major leagues. Their batters left the park more often than just five clubs.

But then the Nationals outslugged the New York Yankees — a group known for slugging — in a series-opening 11-4 win in the Bronx. Josh Bell, Yan Gomes, Josh Harrison and Juan Soto went deep, in that order, accounting for eight runs. Harrison’s homer charged a six-run eighth that was helped along by three errors by the Yankees. He hopped out of the box, aware he had scorched Jonathan Loáisiga’s fastball, before trotting home behind Victor Robles (who had reached on a wide throw by DJ LeMahieu) and Trea Turner (who had poked a go-ahead RBI single).

Washington’s power stood up to two solo shots from LeMahieu and another by Gary Sánchez, all off starter Patrick Corbin. It was an odd way for the Nationals (13-15) to snap a three-game losing streak, especially after they hit only two homers in 27 innings of a sweep to the Atlanta Braves this week.

“We missed having Soto in that lineup and strengthening that lineup all the way through,” said Manager Dave Martinez. “Him in that lineup makes a big difference. We get him back, and you saw what he did today. Hopefully this is the beginning of something good here for a stretch and we’ll take off.”

Soto made his first start since he returned from the injured list Tuesday, plugged in as the Nationals’ designated hitter. He’s not yet cleared to play right field, because he hasn’t consistently thrown at full strength. But Martinez was relieved to get Soto, the club’s best hitter, more than a single pinch-hit appearance. Soto finished with a groundout, two strikeouts looking, a single in the eighth and a two-run homer to left-center off Luis Cessa in the ninth.

But in a twist, after weeks of searching for a burst of power, the early pop was provided by Soto’s teammates. Bell erased LeMahieu’s first homer with a solo shot off Yankees starter Jameson Taillon in the second. Taillon tested Bell with a high four-seam fastball. Bell lifted it 432 feet to center. Gomes then pushed Washington ahead with a two-run blast to left, his fourth of the season and third of the past week — showing that his bat picks up when he plays most days.

“I’m going to be real: We’ve had some unfavorable conditions the first month,” Harrison said, defending an offense that has been slow to come around. “You know, windy, cold. And I’m not making excuses, but sometimes that is tough to deal with, especially at the start of the season when you’re trying to find something or feel something.”

Gomes’s next task was helping Corbin hold down the Yankees (16-16). And for the most part, the pair was able to. A handful of hard-hit balls found the Nationals’ defense. Corbin retired eight straight before LeMahieu tagged him with his second homer to start the sixth, also going to the short porch in right. Through six innings, the teams combined for six total hits and five homers. The only other knock was LeMahieu’s one-out single off Corbin in the third.

The surprise, then, was that the Nationals hung in this type of game. Their hitters had produced a homer in less than 3 percent of at-bats, a rate that put them in the bottom third of baseball. Their pitchers entered with MLB’s worst home run rate for starters and relievers (4.3 percent of all batters faced had put the ball in the seats). On Friday afternoon, with Giancarlo Stanton and Aaron Judge looming in the Yankees’ order, Martinez recognized his staff’s inability to keep hits in the yard. Then Corbin and Tanner Rainey left Stanton and Judge hitless in eight at-bats.

“For me, trying to be careful going in with that sinker away, making sure it’s there,” Corbin said of how to monitor the Yankees’ power. “Knowing some of the guys there can basically hit a flyball [for a homer to right]. They’re strong enough to do that. I mean, you definitely think about it.”

The count was even at 1-1 on LeMahieu’s homer in the first. With the next two, Corbin was actually ahead. Of the three critical pitches, only the third — the one resulting in LeMahieu’s second homer of the night — was well inside the strike zone. Corbin called the slider to Sánchez his worst pitch of the outing, saying it had to spike in the dirt instead of hanging below the batter’s knees. Otherwise, he was happy beyond the few mistakes.

The box score doesn’t see those details. It just read 3-3 as the seventh passed without a run. Then it read 7-3, with the Nationals leading, once Harrison’s blow flew over the left field fence. That ticked to 8-3 after Kyle Schwarber singled in Soto. It ticked to 9-3 because Gomes’s grounder rolled below shortstop Gleyber Torres’s glove. And in the in the ninth, when Soto punched his homer, it was a tried-and-true blowout.