BOSTON -- Jacoby Ellsbury singled in the winning run with his fourth hit of the game in the ninth inning, and the Boston Red Sox beat New York 4-3 on Tuesday night, dropping the Yankees into a tie for first place in the AL East.
Pedro Ciriaco, who started the rally with a single, slid in to beat the throw from right fielder Ichiro Suzuki to give Boston its second win in 13 games.
The loss left the Yankees and Orioles tied with 79-62 records. Baltimore beat Tampa Bay 9-2 on Tuesday night. The Rays are two back in the division.
Andrew Bailey (1-0) got the win after allowing one hit in one inning.
David Robertson (1-7) retired his first four batters before giving up Ciriaco's single to left field with one out in the ninth. Mike Aviles then singled into the shortstop hole where Derek Jeter fielded the ball but couldn't make the throw.
Then Ellsbury capped an outstanding performance on his 29th birthday with a sharp single to right.
The Red Sox wasted a chance in the seventh when they loaded the bases with one out and couldn't score. But they got outstanding work from their bullpen, which allowed just a hit and a walk with four strikeouts in 3 2-3 innings.
Dustin Pedroia tied the game for Boston in the sixth with a solo shot, his 15th of the year and third hit of the game.
The Yankees took a 3-2 lead in the top half on a two-run, ground-rule double by Jeter after a walk to Curtis Granderson, a single by Andruw Jones and a sacrifice by Jayson Nix.
Lester had control trouble from the start, walking three in the first when the Yankees took a 1-0 lead. Jeter led off with a walk, took third on a double by Nick Swisher and scored on a groundout by Robinson Cano. Russell Martin and Steve Pearce also walked but were stranded.
Lester walked the first two batters in the third and the leadoff hitter in the fourth but retired the next three batters in each inning. Then he struck out the side in the fifth, giving him 1,045 career strikeouts, the most by a Red Sox lefty. Bruce Hurst had the old mark of 1,044.
The Red Sox took a 2-1 lead in the third on a double by Ciriaco and RBI singles by Ellsbury and Pedroia.
Ciriaco went 2 for 3 and is 17 for 35 in nine career games against the Yankees, all this season with the Red Sox.
NOTES: Lester's previous career high was five walks on nine different occasions, most recently on July 22 in a 15-7 loss to Toronto in which he allowed 11 runs. ... Yankees LHP Andy Pettitte is scheduled to throw in a simulated game Wednesday. He's trying to work his way back into the rotation after breaking his ankle June 28. Pettitte hopes to throw about 60 pitches. ... Injured 1B Mark Teixeira also was with the club even though he is sidelined for up to two weeks with a strained left calf, an injury he aggravated Saturday. "I think we can get plenty of work done here. There's really not that much I can do anyway. It's a lot of ice and a lot of ultrasound and stuff like that," Teixeira said. ... Swisher snapped an 0-for-28 slump with his double in the first. ... David Phelps (3-4) pitches for the Yankees against Aaron Cook (3-9) in the second game of the three-game series on Wednesday night. ... Yankees starter Hiroki Kuroda issued no walks and has just 14 in his last 15 starts.