ATLANTA — Nick Markakis singled in the go-ahead run in the seventh inning, Pedro Ciriaco added a pair of RBI singles, and the Atlanta Braves beat the struggling Boston Red Sox 5-2 on Wednesday night.

The Red Sox, who began the night in last place and eight games out in the AL East, have dropped eight of nine overall and 11 of 12 on the road.

Red Sox manager John Farrell showed his frustration in the bottom of the seventh, getting ejected for arguing balls and strikes.

Atlanta, which has won three of five, took its first lead at 3-2 in the seventh when Markakis singled to score Cameron Maybin. Markakis’ hit came off Junichi Tazawa (0-3), who gave up three hits, two runs and one walk in two-thirds of an inning.

Tommy Layne relieved Tazawa and gave up a bases-loaded walk to A.J. Pierzynski that made it 4-2. Craig Breslow, the sixth Boston pitcher, allowed Maybin’s RBI single that made it 5-2 in the eighth.

Nick Masset (2-1) earned the win in relief, facing four batters in the seventh, and Jason Grilli recorded his 18th save in 20 chances. Mookie Betts led off the ninth with a single, but Grilli struck out Blake Swihart and pinch-hitter David Ortiz and Dustin Pedroia each popped up.

Farrell’s ejection marked the third time he left the dugout and returned dissatisfied.

He lost an instant replay challenge in the first when Brock Holt was thrown out at second on Xander Bogaerts’ fielder’s choice. In the second, Farrell failed to persuade first-base umpire and crew chief Larry Vanover to request a video review after Betts was called out on a close play at first.

Boston took a 1-0 lead in the fourth when starting pitcher Joe Kelly, batting with the bases loaded, beat out second baseman Jace Peterson’s throw for a single.

Braves third baseman Juan Uribe amended his throwing error from the top of the fourth with a leadoff single in the bottom of the inning. Uribe advanced to second on a groundout and scored on Ciriaco’s RBI single to make it 1-1.

Mike Napoli’s 10th homer, solo shot in the sixth, put the Red Sox up 2-1.

In the bottom of the sixth, Markakis scored from third on Ciriaco’s single off Alexi Ogando, the third Boston pitcher of the inning.

Kelly allowed five hits, two runs, three walks and struck out three in five-plus innings. Kelly was chased by Uribe’s single in the sixth.

Braves starter Alex Wood gave up five hits, two walks, struck out seven and allowed two runs – one earned.