The three-run rally allowed the Dodgers to take two of three from the Giants, who trail NL West-leading San Diego by six games.
"We've been coming from behind for a long time and we have plenty of games to play," Giants closer Armando Benitez said.
Third baseman Edwards' throwing error led to the Giants scoring the go-ahead run in a 3-1 victory Monday night.
"Some days it's not going to go your way, so you have to stay positive," he said. "This is one of the better moments in my career."
Benitez (1-2) came on in the ninth and walked pinch-hitter Ricky Ledee with one out before Robles drove a 2-2 pitch into the lower seats in the right-field corner for his second homer of the season.
"I knew if I hit a grounder, the game is over," Robles said. "I hit it pretty good."
Benitez walked Jeff Kent before he was replaced by rookie Jeremy Accardo. The right-hander, who gave up Kent's game-ending homer Tuesday night, fielded a comebacker by Olmedo Saenz on a hit-and-run play and tried for the force at second, but threw the ball into center field, putting Kent at third.
"This is a little trial for him to test his toughness, but his stuff is right," catcher Mike Matheny said of Accardo. "He's got the kind of stuff where you want him on the mound. He's going to be very good. It just depends on how quickly he learns how to adjust himself during times like these."
An intentional walk to Jose Cruz Jr. loaded the bases for Edwards, who lined a 3-2 pitch to right-center with the infield and outfield playing in. He was 0-for-4 prior to that, and also went 0-for-4 in the Dodgers' win Tuesday night.
"With one out, you got to look for a pitch you really want to drive," Edwards said.
Yhency Brazoban (4-8) got the victory, pitching a scoreless ninth.
Cruz drove in four runs with a pair of homers, the second of which cut San Francisco's lead to 8-6 in the eighth.
"A lot of young people participated again tonight and are beginning to sow their oats and respond to pressure-type situations," Dodgers manager Jim Tracy said.
Giants starter Jason Schmidt gave up four runs and three hits in 4 1/3 innings, struck out five and walked three before he strained his right groin while pitching to Robles.
"I had a rough first inning, then was just starting to settle in and was putting the ball where I wanted," Schmidt said. "Then, bam. When I wake up tomorrow, it could be a whole different story."
The Dodgers' Jeff Weaver allowed six runs and six hits in 6 2/3 innings, struck out five and walked two.
The Giants tied the game at 5 on Matheny's three-run homer off Weaver, who gave up a leadoff single to Pedro Feliz and then hit Todd Linden. One batter later, Randy Winn connected on an 0-1 pitch to give the Giants a 6-5 lead.
Los Angeles loaded the bases in the bottom of the seventh, but Scott Eyre struck out Saenz to end the inning.
The Dodgers scored four runs in the first to erase a 2-0 deficit. Robles doubled into the right-field corner to score Jayson Werth, who walked.
Kent walked, then Cruz hit a 2-0 pitch from Schmidt into right-center field, extending the Dodgers' lead to 4-2.
Cruz homered again in the eighth off Eyre, his 15th of the season and first right-handed.
Schmidt struck out Werth to open the fifth before being replaced by Jeff Fassero, who struck out Robles. Then Kent hit his 27th homer, which barely cleared the left-field wall, making it 5-2.
The Giants led 2-0 in the first on a RBI double by J.T. Snow and a run-scoring single by Moises Alou.
- Cruz hit his first 14 homers this season left-handed, although he is a natural right-hander. It was the third time a Dodger has homered from both sides of the plate this season, with OF Milton Bradley doing it April 18 and May 13.
- The Giants activated RHP Tyler Walker from the DL and he appeared in relief.