Updated

Pinch-hitter Mike Carp's RBI single in the eighth inning lifted the Boston Red Sox over the Baltimore Orioles, 4-3, in the second test of a three-game series.

Dustin Pedroia tied the game in the seventh with a two-run single. Shane Victorino added an RBI single for the Red Sox, who have won four in a row and lead the Tampa Bay Rays by 2 1/2 games for first place in the AL East.

Boston starter John Lackey allowed three runs on seven hits over 7 1/3 innings. Craig Breslow (4-2) recorded the final two outs in the eighth to pick up the win.

Chris Davis hit his MLB-leading 47th homer of the season and knocked in two runs for the Orioles, who trail Boston by 7 1/2 games in the division. Manny Machado hit a solo homer and scored twice.

Bud Norris got the start for Baltimore and gave up one run on four hits while striking out seven and walking four over 5 1/3 innings. Tommy Hunter (3-3) allowed one run on two hits in the eighth to take the loss.

"I battled hard and that's a good ball club over there, you have to tip your hats to them," said Norris. "We just didn't get the bounces we needed today."

Trailing 3-1, the Red Sox scored a pair of runs in the seventh. Stephen Drew led off with a double to right and moved to third on Jacoby Ellsbury's single to shallow center field. Darren O'Day came in from the bullpen and Ellsbury immediately stole second. After Victorino lined out to second, Pedroia hit a two-run single to left.

Boston took the lead during its next at-bat. With two outs, Jarrod Saltalamacchia doubled off the Green Monster. Drew was then intentionally walked. Carp followed with a bloop single over the head of the third baseman Machado.

"Sometimes you don't get the at-bats that you want," said Carp. "But when you're a part of this team and this clubhouse, the way we go about our business it's a dream team and a lot of fun and just a great season all together."

Koji Uehara tossed a perfect ninth to record his 14th save of the season.

Baltimore got on the board in the first inning. Machado reached base on an infield single and raced home on Davis' double down the right-field line.

Machado's homer over the Green Monster in the third made it a 2-0 game.

The Red Sox, however, got the run back in the bottom half. Drew walked and Ellsbury singled to put men on first and second with one out. Victorino's RBI single to center cut the gap to 2-1. Pedroia followed with a walk to load the bases, but David Ortiz and Daniel Nava both struck out to end the inning.

Davis' homer in the sixth hit off the railing and bounced into the seats, making it 3-1 Baltimore.

Game Notes

Boston and Baltimore have split 12 games this season ... Ellsbury left the game in the top of the eighth after fouling a ball off his right foot during his seventh-inning at-bat ... The Orioles recalled top prospect Kevin Gausman from Triple-A Norfolk before the game and optioned pitcher Wei-Yin Chen to their Gulf Coast League affiliate.