San Francisco, CA (SportsNetwork.com) - Jace Peterson's bases-clearing triple in the ninth inning led the Atlanta Braves to a 7-5 win over the San Francisco Giants.

Juan Uribe hit a two-run home run while Freddie Freeman added a solo shot for the Braves, who won the final two of this set after losing four of five.

Julio Teheran pitched six-plus innings and allowed three runs on four hits with four walks. Nick Masset (1-1) got the win for 1 2/3 scoreless innings.

Joe Panik hit a two-run homer while Brandon Belt and Brandon Crawford added solo shots for the Giants, who dropped the last two of this set after winning five in a row.

Madison Bumgarner allowed three runs on five hits with a walk and six strikeouts in 6 1/3 frames, while Santiago Casilla (4-1) was saddled with the loss.

"We had a good month," said Giants manager Bruce Bochy. "It would have been nice to get this one. That's baseball. You have to deal with this kind of game occasionally, hopefully not too many of them. But we've got to carry the momentum we've had into June."

Trailing by two, Freeman made it a one-run game with his one-out homer in the ninth. The next three batters reached base before Peterson launched a triple to the gap in right-center for a 7-5 lead.

"You can say a lot of stuff about our team, that we're short and we've got some deficits in certain areas, obviously, like every other team does," said Braves manager Fredi Gonzalez. "But one thing we're not short of is fight. And willingness to not give up. These guys battle and battle. After we take the lead, the Giants take the lead again, and we didn't give up. We had two more innings to try to get back in the game, and we did."

Jason Grilli gave up a two-out double to Panik in the home ninth, but got Hunter Pence to fly out to end the inning.

Belt and Crawford hit back-to-back home runs to start the second and give the Giants a 2-0 lead.

Atlanta was held hitless through the first four innings, but Jonny Gomes singled to start the fifth and moved to second on a Uribe groundout. Following a passed ball from Buster Posey that moved Gomes to third, Chris Johnson punched a single to center to make it a 2-1 game.

The Braves then went on top in the seventh as Gomes walked with one out and Uribe followed with his third homer of the year for a 3-2 lead.

San Francisco, though, answered in the home half to take the lead back. Matt Duffy doubled to lead off and Gregor Blanco followed with a single off Donnie Veal to tie the game. Two batters later, Panik clubbed a shot well over the wall in right for a 5-3 advantage.

Game Notes

San Fran had won 11 of the last 15 against Atlanta coming into the game ... Freeman was able to extend his consecutive games played streak to 218, the longest current active streak in the majors ... Atlanta plays three in Arizona beginning Monday ... San Fran hosts Pittsburgh for three games starting Monday.