The Braves had their best starting pitcher, Julio Teheran, on the mound Sunday, but sooner or later the law of averages said the Marlins had to win a game against Atlanta.

They did Sunday, scoring five runs in the sixth and seventh innings to pull away for a 7-3 win at Turner Field. A sellout crowd of 50,247, many of them drawn by the postgame concert by Chris Stapleton, saw the Braves’ bid for their first home-series sweep thwarted.

As it was, winning two of three against the Marlins gave the Braves their only series win of the season at Turner Field, where they have a 4-21 record. The Braves are 5-1 against the Marlins this season and 9-34 against everyone else.

Teheran (1-5) was charged with five hits, three runs and three walks with one strikeout in 5 1/3 innings, and was replaced after giving up a long two-run homer to Derek Dietrich that put the Marlins ahead 3-1 in the sixth.

Dietrich, who played collegiately at Georgia Tech, had a career-high four RBIs and left the game in the ninth inning after being hit in the head by a foul ball off the bat of teammate Christian Yelich that caromed off the dugout wall before it struck him. He was to be examined by a doctor and there was a possibility he would stay overnight in Atlanta.

Teheran was slowed by a blister on top of a toe on his right foot, which he said had bothered him for three starts but worsened Sunday.

“Hopefully for my next start I can get it (cleared up),” he said. “I battled the whole game. You try to put (the blister) aside. I battled, did my best.”

Teheran allowed more than two runs for only the second time in 10 home starts going back to Sept. 1, and recorded fewer than three strikeouts for the first time since he had consecutive one-strikeout games May 26 and May 31, 2015, at Los Angeles and San Francisco.

“He battled his way through it,” Braves manager Brian Snitker said. “That blister was giving him a little problem with his foot, then he kind of regrouped, I thought. Held us right there until the homer. He was working really hard.”

Teheran had collected 42 strikeouts with nine walks in 40 2/3 innings while posting a microscopic 0.89 ERA and .174 opponents’ average during his past six starts before Sunday.

A.J. Pierzynski did the catching Sunday, and Teheran now has a 4.31 ERA in 39 2/3 innings with Pierzynski behind the plate and a 0.63 ERA in 28 2/3 innings with Tyler Flowers catching. Flowers caught each of Teheran’s previous three starts before Sunday, and four of his past six.

Snitker went with Pierzynski in the series finale, because he was 8-for-17 with two homers against Marlins starter Tim Koehler before facing him Sunday. (It’s worth noting, Pierzynski caught when Teheran held Boston to one run and six hits in seven innings on April 25 in the first game of his six-start tear).

Pierzynski’s sacrifice fly in the fourth inning accounted for the Braves’ only run through seven innings. It came after Jeff Francoeur drew a walk and Nick Markakis doubled to put runners at second and third with one out.

Koehler (3-5) limited the Braves to three hits and three runs (two earned) in seven-plus innings, with two of those runs scoring in the eighth after he failed to retire any of three batters he faced.

“To me, he hit his spots and made good pitches, didn’t leave a lot over the plate,” Braves second baseman Gordon Beckham said. “He was good. He was nibbling a little bit, but making good pitches to where people weren’t just taking them. We were trying to go after him and he was just on the edge of the plate. He made his pitches and got us out.”

The Braves advanced only three runners to second base and one to third before the eighth inning. Trailing 8-1 entering the eighth, they scored two after pinch-hitter Mallex Smith led off with a walk, Ender Inciarte singled, Beckham reached on an infield error, and Francoeur hit a sacrifice fly.

Freeman’s struggles with runners in scoring position continued when he struck out with two runners in scoring position and none out in the eighth.

Koehler has a 2.56 ERA in his past five starts, but Miami lost five consecutive starts by the right-hander before Sunday. The Marlins scored almost as many runs (six) in the first seven innings as they totaled while Koehler was in the game during his previous four starts (seven runs).

He issued five walks apiece in three consecutive starts before Sunday, when Koehler walked four Braves but didn’t pay the price for any of the free passes except Francoeur’s in the fourth inning.

After issuing consecutive one-out walks in the first inning, Koehler got ground-outs from Francoeur and Markakis to get out of the inning. After walking Ender Inciarte with one out in the third inning, he induced a double-play grounder from Beckham.