MILWAUKEE - Carlos Gomez guessed right.

Gomez hit a go-ahead, three-run homer in the eighth inning and also had a solo shot in the sixth to help the Milwaukee Brewers beat the Atlanta Braves 6-5 on Wednesday.

The Brewers trailed 5-3 before Gomez's eighth home run off reliever Luis Avilan (2-3), who failed to hold the lead for Julio Teheran and Atlanta. Shane Peterson and Gerardo Parra each reached on bloop hits before Avilan struck out Jonathan Lucroy. Gomez followed and drilled a 3-1 pitch into the seats.

Gomez went through the pitches Avilan would challenge him with and decided to wait for a particular one.

"He threw me a really good one the first pitch," Gomez said of Avilan's changeup. "I never thought he'd throw me a fastball. The curveball is the best pitch he has. He knows I'm aggressive. He threw me a good changeup on the plate, and I put a pretty good swing on it."

Atlanta catcher Ryan Lavarnway didn't find fault with the pitch, just the result.

"It was a good pitch to him," Lavarnway said. "That was a good pitch we made. Credit to him. He hit it. He's one of their guys."

It was the 99th career home run for Gomez, who has been playing hurt for much of the season.

"We haven't gotten him out there much when he's been 100 per cent," manager Craig Counsell said. "He's there now."

Gomez was on the 15-day DL with a strained right hamstring from mid-April to the first of May. He hit a grand slam at Cincinnati on July 3 in the Brewers' 12-1 win.

Jeremy Jeffress (3-0) picked up the win with 1 1-3 scoreless innings of relief, and Francisco Rodriguez pitched the ninth for his 19th save in as many chances.

Teheran pitched seven strong innings but Atlanta failed to sweep the three-game series.

Backed by home runs from Cameron Maybin and Kelly Johnson, Teheran looked headed for his first road win since beating Miami on opening day.

He is 0-5 in nine starts away from Turner Field since that win. He allowed three runs on just two hits, both home runs, walked three and tied his season high with eight strikeouts. He also struck out eight when he beat Milwaukee 10-3 on May 21.

Lavarnway said that Teheran settled down after a 24-pitch first inning. He walked two, but then kept them from scoring.

"He's competing his butt off, and I think that's what is important," Lavarnway said. "Sometimes it takes a little kick in the pants for him to flip the switch to get angry and real competitive."

Maybin's two-run homer and Johnson's solo shot off Milwaukee starter Mike Fiers highlighted the Braves' four-run third inning. Nick Markakis knocked in a run with a double in the seventh.

Khris Davis gave the Brewers some hope in their half of the fourth with his first home run since May 25, a two-run shot that banged off the scoreboard in deep centre. He had just been activated from the 15-day disabled list on Tuesday after missing 35 games with a torn meniscus in his right knee.

Gomez hit his seventh to pull Milwaukee to 4-3 in the sixth.

Fiers allowed four runs on four hits over six innings.

TRAINER'S ROOM

Braves: Freddie Freeman (right wrist contusion) continues to receive medical treatment back in Atlanta. The club expects his return some time after the All-Star break. He has been on the 15-day DL since June 23, retroactive to June 18.

Brewers: Manager Craig Counsell sat 3B Aramis Ramirez and RF Ryan Braun, but expects them both to play Friday. With Thursday being a day off, Braun gets two days to rest his sore right wrist.

CAN'T KEEP IT IN THE PARK

The Brewers' pitching staff leads the majors with 98 home runs allowed. Maybin and Johnson's homers pushed the opponents' total to 72 at Miller Park.

BRAVES STILL LEAD ALL-TIME SERIES

The Braves lead the all-time series with Milwaukee 75-49, including 34-25 at Miller Park.

UP NEXT

Braves: LHP Alex Wood (6-5) makes his second career start Thursday against the Rockies when he opens the four-game series at Colorado. He allowed three runs on six hits in seven innings, walked one and struck out seven in the 11-3 win on July 30, 2013.

Brewers: RHP Jimmy Nelson (6-8) looks for his fourth consecutive victory on Friday when he makes his 18th start of the season and first against the Dodgers in Los Angeles.