Rookie James Loney tripled, doubled and scored twice for NL West-leading Los Angeles, which has won 14 of 15 after a 1-13 slide coming out of the All-Star break.
"Everybody was quiet and down before, and now everybody's having fun," Penny said. "We're out there playing like we all thought we could play. You go out there every day expecting to win, and your whole attitude changes.
"This is a huge stretch right here. After we play the Marlins we've got the Giants again and then San Diego and Arizona. So I couldn't think of a better time to start playing this good."
Moises Alou and Omar Vizquel each drove in two runs for San Francisco, which has lost four straight. The last-place Giants are 6½ games behind Los Angeles after falling a season-worst eight games under .500.
Penny (13-5) won his third straight start, allowing four runs -- three earned -- and seven hits over six innings. The right-hander struck out seven and did not walk a batter for the second consecutive outing.
The Giants closed to 6-5 in the seventh with doubles by pinch-hitter Todd Linden and Vizquel against Giovanni Carrara. Lefty Joe Beimel came in and walked Ray Durham before retiring Barry Bonds on an inning-ending grounder with runners at the corners. The play was made by shortstop Rafael Furcal with the Dodgers playing a three-man shift on the right side of the infield.
Bonds is 1-for-9 lifetime against Beimel -- with a home run.
"I'll take that anytime," the 29-year-old reliever said with a grin. "I knew Durham was hitting pretty well off left-handers this year, and I didn't want to give in to him.
"Barry's one of the greatest hitters of all time -- but at the same time, he's not having the kind of year he's had in the past."
Jonathan Broxton pitched a perfect eighth inning and Takashi Saito worked the ninth for his 13th save in 14 attempts. Steve Finley flied out to the warning track for the second straight time with a runner on base, and then Saito retired Vizquel on a groundout to first base to end it.
San Francisco has dropped 15 of 18 after a season-high five-game winning streak, and won just one of its last 12 on the road. Matt Cain (8-9) allowed six runs and a career-high 10 hits in four-plus innings against a lineup that included three rookies like himself.
Betemit snapped a 4-4 tie in the fifth with his 13th home run and fourth since joining the Dodgers on July 28 in a trade with Atlanta. The drive into the right-field pavilion came on a 3-1 pitch -- Cain's last one of the game.
Trailing 3-0, San Francisco tied it in the fourth on Durham's RBI single and a two-run single by Alou. Sandwiched between those hits was a double by Bonds, who was 1-for-4 and has gone 22 at-bats since his previous home run on Aug. 4 against Colorado.
The Dodgers regained the lead in the bottom half when Loney led off with a double, advanced on Penny's sacrifice bunt and scored on a single by Furcal, who is hitting .365 with runners in scoring position.
"That's the worst feeling you can have -- to sit there and watch the team battle back and get runs for you and then you go back out there and give it back," Cain said. "That's not acceptable. That's terrible. That's probably one of the most upsetting things for me."
The Giants pulled even again in the fifth, thanks to some typical hustle by the 40-year-old Finley. He hit a two-out grounder to second baseman Julio Lugo, who bobbled the ball for an instant. That's all it took for Finley to beat the throw and stick Lugo with an error. Finley stole second and scored on a single by Vizquel that extended his hitting streak to 11 games.
It was the first unearned run allowed this season by Penny, who gave up only two in 29 starts last year.
The Dodgers grabbed a 2-0 lead in the first on Lugo's RBI double and J.D. Drew's run-scoring single. They made it 3-0 in the second when Loney tripled and scored on a popup by Penny that second baseman Durham lost in the sun.
- After the game, the Giants optioned RHP Brian Wilson to Triple-A Fresno and recalled LHP Jack Taschner from Fresno.
- The Dodgers acquired C Einar Diaz from Cleveland for cash. Diaz will report to Triple-A Las Vegas.
- Bonds, an eight-time Gold Glove winner, has made 81 starts in left field this season and has yet to commit an error. The fewest he ever made over a full big league season was one -- in 1989 with Pittsburgh and 1996 with the Giants. He had none last year, but was limited to only 14 games because of three knee operations.
- Every team in the NL West has now spent at least 20 days in first place, and no fewer than 22 days in last place.
- Bonds needs 44 more total bases to tie Pete Rose for sixth place on the career list at 5,752.
- Dodgers rookie Andre Ethier extended his hitting streak to 16 games with a single his first time up.