Bronx, NY (SportsNetwork.com) - Baseball's most intense rivalry went to another level Friday night ... or Saturday morning if you're keeping score.

The Red Sox and New York Yankees played the second-longest game by innings in their historic matchup, but in the end Xander Bogaerts scored on Mookie Betts' sacrifice fly in the 19th inning to send Boston to a 6-5 win.

"We were finally able to keep a one-run advantage," Red Sox manager John Farrell said. "We could go on and on about some individual plays, but this was a test of endurance."

The game lasted 6 hours, 49 minutes, the longest in the 115-year history of the Red Sox.

That didn't include a 16-minute delay due to a power outage in the 12th inning.

"It was one game, but it seemed like six," Yankees manager Joe Girardi said.

It was the second-longest contest between the teams, only short of an Aug. 29, 1967 game that went 20 frames, a 4-3 New York win.

Esmil Rogers (0-1), the eighth pitcher for the Yankees, gave up a one-out single to Bogaerts, who then stole second. After Ryan Hanigan walked, the players advanced on a passed ball. Betts then lifted a sacrifice fly to center and there was no play at the plate.

Rogers, who lasted 4 2/3 innings, then managed to retire Dustin Pedroia on a fly ball to right.

"That was his last hitter. That was the only place we could go," said Girardi, who added that the next pitcher would have been first baseman Garrett Jones.

Steven Wright (1-0) gave up six hits and two runs over the final five innings to get the win in the opener of this three-game set, which ended at 2:13 a.m. ET.

Incredibly, the teams will be back on the field for a 1:05 p.m. start on Saturday.

Edward Mujica, filling the closer's role with Koji Uehara beginning the season on the disabled list, had quickly retired the first two hitters in the ninth. His fastball on the inner half to Chase Headley on a 2-1 count was crushed into the second deck in right, however, giving the Yankees renewed life and setting the stage for the drawn-out ending.

Mujica's blown save denied Wade Miley a win in his Boston debut. The left- hander, one of three new additions to a revamped Red Sox rotation, held the Yankees to two runs and four hits while striking out six over 5 1/3 innings in the lefty's Boston debut.

There was more drama in the 16h when David Ortiz homered to right, but Mark Teixeira actually had the tying homer on his 35th birthday. His second homer of the season came after well after midnight a leadoff blast to left field to start the home 16th.

Pablo Sandoval singled in Pedroia in the 18th, but Carlos Beltran doubled in John Ryan Murphy in the bottom portion. Didi Gregorius grounded out to strand Beltran at third.

"It's hard. Our guys did a good job of coming back, coming back, coming back. It's a grind," Girardi said.

Nathan Eovaldi's first start as a Yankee didn't go quite as well. The hard- throwing 25-year-old, acquired from Miami over the winter, was reached for three runs and eight hits in 5 1/3 innings.

Eovaldi never had a clean inning and got into some early trouble when Pedroia singled off a triple-digit fastball and Hanley Ramirez laced a base hit two batters later to put two on in the top of the first inning.

Sandoval, who entered the game 8-of-11 lifetime against Eovaldi, then socked a flat slider into center field for an RBI single.

Daniel Nava's single off the glove of a diving Teixeira plated two runners in the sixth, but New York finally broke through in the bottom of the sixth. Miley surrendered a leadoff walk to No. 9 hitter Gregorio Petit, a base hit to Jacoby Ellsbury and Alex Rodriguez's sharp single up the middle brought the Yankees within 3-1.

After a walk to Teixeira loaded the bases and ended Miley's night, Brian McCann greeted Robbie Ross with a sac fly to the warning track in right.

Game Notes

It was the longest game for the Yankees by innings since 1976 when they beat Minnesota in 19 innings ... Bogaerts and Sandoval each had four hits, part of an 18-14 Boston advantage in the hits department ... Ortiz now has homered six times in his last 13 games against the Yankees ... Eovaldi is winless in 10 starts (0-8, 2 ND) since collecting his last victory at Cincinnati on Aug. 8 of last season ... Bogaerts and Gregorius were each members of the Dutch National Team that won the 2011 Baseball World Cup. Both players were later knighted by the Dutch government for the accomplishment ... Boston left 20 men on base compared to 13 for the Yankees.