Chris Denorfia led off the 12th with a single off Kris Medlen (6-2), Atlanta's seventh pitcher. Denorfia stole second base as Tony Gwynn Jr. struck out for the second out. An intentional walk to Oscar Salazar put runners on first and second for Hundley, who pinch-hit for Tim Stauffer (3-1).
Hundley's double down the left-field line made it 6-4.
Heath Bell earned his 27th save with three strikeouts in the bottom of the 12th. The game lasted 4 hours, 13 minutes.
It was the fourth blown save for Wagner, who couldn't hold a 4-2 lead in the ninth. The Padres rallied with Scott Hairston's pinch-hit homer, a single by Jerry Hairston and Yorvit Torrealba's tying double to right.
Stauffer pitched two scoreless innings to lower his ERA to 0.33.
The Braves led 4-2 after Brian McCann's two-run homer capped a four-run third inning. The homer followed Chipper Jones' two-run single as the Braves took the lead with four straight two-out hits.
The Padres (55-38) moved past the Braves (55-39) for the best record in the National League. The two first-place teams have split the first two games of a three-game series.
Wagner's fourth blown save cost Tommy Hanson a win. Hanson gave up six hits and two runs in 6 1/3 innings. He walked two and struck out five.
San Diego's Jon Garland allowed six hits and four runs in five innings.
Hanson hit Will Venable and Jerry Hairston with pitches in the second and fourth innings, respectively. Hanson leads the major leagues with 13 hit batters.
Garland untucked Troy Glaus' shirt by hitting the first baseman with a pitch above the belt in the fifth.
Venable stole second base after his second-inning single. He scored on Everth Cabrera's single. Hairston added a run-scoring single for a 2-0 lead.
San Diego's Adrian Gonzalez was 0 for 6 with four strikeouts.Two outfielders -- Venable and Atlanta's Nate McLouth -- started after coming off the disabled list. McLouth missed 33 games with a head injury. Venable missed 13 games with a lower back strain.
Game notes: Padres 2B David Eckstein was placed on the 15-day DL with a right calf strain. He left Tuesday night's game with the injury. ... Jones returned after missing three starts with a mild left hamstring strain. ... The Braves optioned OF Gregor Blanco to Triple-A Gwinnett to clear a spot for McLouth. ... Atlanta's Jason Heyward had two hits, giving him five in the first two games of the series and a five-game hitting streak as he gains momentum following his return from a thumb injury. The rookie stole second base in the seventh.