NEW YORK (AP) — David Price picked an excellent time to erase his Boston zero in the Bronx.The left-hander finally won at Yankee Stadium for the first time with the Red Sox, backed by early homers from J.D. Martinez and Xander Bogaerts in an 8-5 victory over the Yankees Sunday night.

"It was a much-needed win for us," Price said. "I did stuff here differently today than I have in my past four or five starts. We'll continue to switch it up."

The defending World Series champions stopped a four-game losing streak and improved to 1-4 against the Yankees this season, preventing a three-game sweep in a series shortened by a rainout.

Thunder and lightning crackled in the eighth inning of this one as New York tried to rally in a brief rain against frazzled reliever Matt Barnes, who looked incredibly uncomfortable on the mound even after the grounds crew applied drying agent.

Barnes spiked pitches, kicked at the mud, walked consecutive batters and balked home a run. He gave up three runs before finally settling down and getting out of the inning.

Brandon Workman tossed a scoreless ninth for his second career save, both in the past two weeks.

The third-place Red Sox moved within 8½ games of the AL East-leading Yankees, who have a 2½-game advantage over Tampa Bay. The next time baseball's biggest rivals meet is June 29-30 in London, with Boston the home team for the first two major league games in Europe.

Luke Voit homered for the Yankees, who lost for only the sixth time in 26 games. They don't visit Fenway Park until July 25-28.

Price (3-2) permitted two runs and six hits with six strikeouts in 6 1/3 innings, outpitching CC Sabathia in a matchup of AL Cy Young Award winners.

"He was great. Good command, good mix of pitches," Red Sox manager Alex Cora said. "I'm happy for him that he came here and pitched the way he did. He's been outstanding the whole season. It didn't surprise me."

Since signing a $217 million, seven-year contract with the Red Sox before the 2016 season, Price had been 0-6 with a 9.79 ERA in six starts at Yankee Stadium.

Including the playoffs, he is 3-8 in 13 starts against New York since joining Boston — 0-4 with a 10.90 ERA in five games last year.

"I think he went to some places today that he didn't last year," Cora said. "He made some adjustments and like I said, he found a few things in October that have carried on throughout the season and he's in a good place right now."

Price, who changed his jersey to No. 10 this season as a salute to his son, is 16-14 versus New York overall — the most wins for any active pitcher against the Yankees. He has also played for Tampa Bay, Detroit and Toronto.

Price retired his first 10 batters before giving up four straight hits in the fourth, snapping a streak of more than 14 innings without allowing an earned run.

"He seemed sharp to me," Yankees manager Aaron Boone said.