Bases loaded. Two out. Already trailing by two runs in the fifth inning, New York Yankees manager Joe Girardi decided he couldn't wait any longer.

Out went starter Bartolo Colon and in came Boone Logan, the only left-hander in the Yankees bullpen, to face Red Sox All-Star Adrian Gonzalez.

"That's a big situation," Logan said Friday night after striking out Gonzalez, who leads the majors with a .356 batting average and 91 RBIs, to end the scoring threat. "You can't think of it like, 'It's Adrian Gonzalez.' That's where you can get into trouble."

Five New York relievers combined to throw 4 1-3 shutout innings after Colon couldn't make it out of the fifth, and the Yankees scored three in the top of the sixth to win 3-2 and take over the lead in the AL East. It was the eighth straight win for the Yankees, who had beaten Boston just once in nine previous meetings this season.

"They are human," right fielder Nick Swisher said. "They can be beat. It was a big lift for us."

Swisher had two hits, including an RBI double off Jon Lester (11-5) to give the Yankees a 3-2 lead. Mariano Rivera pitched the ninth for his 29th save, striking out Josh Reddick for the final out as the Yankees took over the top spot in the division for the first time since July 6.

The Red Sox led 2-0 after four and loaded the bases against Colon in the fifth. With Gonzalez up, Girardi brought in Logan (3-2).

"Bases loaded; there's no room for error on Boone's part. That's a huge statement," Girardi said. "It's a big win, To be able to come from behind when Lester was dealing; to be able to scratch three runs across by some great at-bats, that was a big win for us."

Lester, who had won five consecutive starts against the Yankees, allowed three runs on five hits and four walks, striking out seven in six-plus innings. David Ortiz homered and Reddick had a pair of hits for Boston, which had been a season-high three games in front of New York on July 24.

They still led by 2½ on the morning of July 30 before the Yankees swept the Orioles in a doubleheader to start their winning streak. But the teams came into the three-game series at Fenway Park tied for the best record in the AL, both 68-42.

"It's probably going to be close," Red Sox outfielder Carl Crawford said. "A photo finish."

The game brought out the stars, with Seinfeld co-creator Larry David and Spike Lee rooting for the Yankees and Aerosmith frontman Steven Tyler and Peter Farrelly, of the filmmaking brothers, pulling for the home team. It was a pleasant 71 degrees for the first pitch, and the crowd of 38,006 was the 688th consecutive sellout at Fenway Park.

The fans saw Lester outlast Colon, but only long enough to run into trouble himself in the sixth.

The Red Sox left-hander walked No. 9 hitter Eduardo Nunez and gave up back-to-back singles to Derek Jeter and Curtis Granderson to score one run before Mark Teixeira walked to load the bases. The Yankees tied it on Robinson Cano's 4-6-3 double-play, and then took a 3-2 lead on Swisher's double down the third-base line.

Colon was pulled after throwing 94 pitches in 4 2-3 innings, allowing two runs on six hits and a walk. He gave up Jacoby Ellsbury's RBI double in the third and Ortiz's solo homer in the fourth, then loaded the bases in the fifth before Boone Logan (3-2) struck out Adrian Gonzalez on a checked swing to end the threat.

"I just wasn't able to hold back," Gonzalez said. "They (the bullpen) did a good job. You've got to tip your cap to them."

Logan pitched one inning in all, giving up one hit while striking out one.

Notes: Yankees RHP Mark Prior struck out two and hit a batter during a scoreless inning in the Gulf Coast League, where he is rehabbing from a strained groin and back soreness. ... Game 2 of the series will feature CC Sabathia against John Lackey. Sabathia is 16-5 with a 2.55 ERA this season, but he is 0-3 with a 6.16 ERA against Boston. Including the playoffs, he is 6-10 with a 4.40 ERA against the Red Sox in his career, most of it with Cleveland. Lackey has won four straight decisions. He is 7-9 with a 4.33 ERA against the Yankees in his career. Lackey has faced the Yankees once this year, getting a win on April 8 despite allowing six runs in five innings. ... Jeter was thrown out trying to steal second in the third inning and Nunez was thrown out in the seventh, just the fourth and fifth time in the last 53 attempts a Yankee has been caught stealing. Nunez did break up a double play by upending Dustin Pedroia and forcing a high throw to first. ... Boston SS Jed Lowrie, who has not played since June 16 because of a damaged nerve in his left shoulder, was the DH for Pawtucket on a rehab assignment on Friday. He was scheduled to play shortstop Saturday, take Sunday off and be activated on Monday.