Ryan Ludwick opened the Cincinnati 10th with a leadoff walk against Brian Wilson (1-1). Reds manager Dusty Baker then went to the dynamic Hamilton, and the speedy prospect took second as catcher A.J. Ellis dropped the ball while taking it out of his glove.
Frazier followed with a line-drive single into right field to give Cincinnati five wins in its last six games. J.J. Hoover got three outs for the victory.
Yasiel Puig hit a two-run homer for NL West-leading Los Angeles.
CARDINALS 5, PIRATES 0
The victory moved the Cardinals into first place, a half-game ahead of the Pirates in the NL Central with their third win in four games. Pittsburgh has lost four of six including the first two of the three-game set. The Pirates remain stuck on 81 wins, one shy of assuring them a winning record for the first time since they went 96-66 in 1992.
Wainwright (16-9) had given up 15 earned runs over his previous two starts, both against Cincinnati. He allowed a career-high nine runs in two innings of a 10-0 loss Aug. 28. But he regained his form against the Pirates allowing just two hits.
Jeff Locke (9-5) allowed three runs on three hits over five innings.
BREWERS 5, CUBS 3
Hellweg (1-3) allowed three runs on four hits. He struck out one and pitched around three walks to finally earn his first victory after flourishing in the minors.
Jake Arrieta (2-2) took the loss.
PHILLIES 6, BRAVES 5
PHILADELPHIA -- Freddy Galvis hit a game-ending homer with one out in the ninth inning to lift the Phillies to a win over the Braves.
Galvis, who had four hits, got Papelbon the win by connecting on a 1-0 pitch from Freddy Garcia (0-1) into the seats in right field. It was the first four-hit game for Galvis, who had been 0-for-7 since being recalled from Triple-A Lehigh Valley on Sept. 3. It was his fifth homer of the season.
Freddie Freeman had two hits and two RBIs for NL East-leading Atlanta, which dropped its third straight.
NATIONALS 9, MARLINS 2
MIAMI -- Ryan Zimmerman homered twice and drove in three runs, powering the Nationals to a victory over the Marlins.
Zimmerman hit a two-run shot in the first and a leadoff drive on Nathan Eovaldi's first pitch of the third.
Tanner Roark (5-0) pitched six scoreless innings as the Nationals won for the third time in four games to remain on the fringe of the NL wild-card race.
Eovaldi (3-6) lasted just three innings in his shortest outing of the season. He was charged with five runs and nine hits.
PADRES 2, ROCKIES 1
SAN DIEGO -- Rookie Jedd Gyorko hit a go-ahead homer leading off the eighth inning to give the Padres a win over the Rockies.
Gyorko's shot off Matt Belisle (5-6) came right after the Rockies tied the game at 1 in the eighth inning on a San Diego error.
Gyorko's 17th home run just barely cleared the right field wall as it hit the top padding and avoided the leaping attempt of right fielder Michael Cuddyer.
DIAMONDBACKS 2, GIANTS 1
McCarthy (4-9) gave up one run and six hits while striking out six. Brad Ziegler pitched a scoreless ninth for his ninth save in 11 chances.
Goldschmidt broke a 1-1 tie with a triple to right center in the fifth inning that scored Adam Eaton, who walked.
Matt Cain (8-9) allowed eight hits and two runs in 6 1-3 innings. He struck out three and walked four. He was activated from the 15-day disabled list prior to the game after missing 14 games with a contusion on his right forearm. Coming into the game Cain had just one win in his last nine starts at home, going 1-5 with a 5.36 era over that stretch.
Copyright 2013 by The Associated Press
This story is from ESPN.com's automated news wire. Wire index
MORE MLB HEADLINES
- Kershaw dominates Padres, moves to 15-3
- First-place Angels lose Richards 6-9 months
- Tigers' Price tosses 1-hitter, but loses to Rays
- Sources: Red Sox, Tigers in lead for Castillo