PHOENIX -- Any team with 21 baserunners is tough to beat.
Troy Glaus doubled in the go-ahead run, his 45th RBI, in the eighth inning off Esmerling Vasquez (0-2), then Melky Cabrera raced home from third on Juan Gutierrez's wild pitch in the ninth.
Cabrera was 3 for 5 with a triple, an RBI and a run scored.
Kelly Johnson had three hits, including a home run, and three RBI for Arizona. Justin Upton and Mark Reynolds also homered for the Diamondbacks.
"That was kind of two offenses doing it two different ways," said Atlanta's Chipper Jones, back after missing five games with an inflamed right ring finger. "They scored whenever they got hits because they hit it out of the park. It took us like three hits to score one. Fortunately, we had a ton of hits."
Atlanta starter Kris Medlen singled, walked twice and scored two runs. He left after five innings with a strained left shoulder, the result of a headfirst slide just ahead of Upton's throw from right field for a run that tied it at 4.
X-rays were negative and Medlen said he would be fine.
"It hurt way worse when it first happened," he said. "It feels way better now, just a little tight in the back. I was just trying to make things happen."
Medlen was grateful it was his non-pitching shoulder.
"It kind of felt weird coming out, because it was my left arm," he said, "but it hurt at the time."
Braves hitters drew seven walks to go with their 14 hits.
"I don't know where we stand in getting walks," manager Bobby Cox said. "We're up there pretty good."
In fact, Atlanta leads the majors with 274. One walk came when Arizona reliever Blaine Boyer, just back from Triple-A Reno, was called for ball four for licking his fingers and not wiping them off.
"He did it three or four times," Cox said. "He wiped every once in a while."
Jonathan Venters (1-0) pitched 1 1/3 innings to get the victory. Billy Wagner threw a scoreless ninth for his 10th save in 12 tries.
"Every inning they scored there was a walk involved," Arizona manager A.J. Hinch said. "Extra base runners, extra opportunities in a close game, is not good and they capitalized on it with some key hits."
The game was tied at 3 after two innings, 4-all after six and 5-5 after seven.
"That was a hard-earned game," Cox said. "We left a ton of guys on but yet some of those we hit the ball pretty good, too."
Consecutive singles by Jason Heyward, Jones and Brian McCann put Atlanta up 1-0 in the first.
But solo homers by Johnson and Upton, both just inside the left-field foul pole, made it 2-1 after one. Johnson hit his 13th of the season, third to lead off a game. Upton hit his 10th.
Atlanta answered with two in the second to go up 3-2. Cabrera tripled and Medlen drove him in with a single. The pitcher took second on a wild pitch, then scored on the first of Omar Infante's three singles.
Reynolds needed one pitch to tie it at 3 with an opposite-field shot to right-center, his 14th homer and second in two nights.
Arizona finally scored without a homer in the fifth when John Hester singled, took second on Edwin Jackson's sacrifice bunt and scored when Johnson singled.
Jones was back after taking a cortisone injection on Monday. He went 1 for 6.Notes
Attendance was 17,052, the Diamondbacks' smallest crowd of the season, in the 1,000th regular-season home game in franchise history. ... Arizona's Chris Young has five stolen bases on the homestand. ... The Braves stranded 14 runners after leaving 12 on base in Monday night's 7-4 loss. ... Medlen allowed three homers after giving up just four in his first 18 appearances, five as a starter. ... Atlanta improved to 3-3 on an 11-game road trip, its longest of the season.