• Turning point: Broxton (4-3) hung a pitch letter-high to Ortmeier, who smashed a no-doubter into the seats in right-center to win it. It was his fifth homer of the season.
• Hunt for October: The Dodgers blew a chance to gain a game on the Padres in the NL West and wild-card standings, staying 2 1/2 games back of San Diego in both races after the Padres lost 10-4 at Colorado.
• Figure this: The Dodgers' 11-game winning streak in San Francisco was the team's longest in a road ballpark since getting 13 straight victories at Candlestick Park from Aug. 1, 1976, to Sept. 1, 1977.
• Quotable: "It's hard to believe we've lost 11 straight here. Some streaks are tough to explain, and that's one of them. That was hanging over our heads. -- Giants' Bruce Bochy
-- ESPN.com news services
Giants 5, Dodgers 4
Ortmeier, a rookie switch-hitter not even on the opening day roster, hit a game-winning solo homer with one out in the bottom of the ninth inning, lifting the Giants past the Los Angeles Dodgers 5-4 on Friday night to end an 11-game home losing streak to their archrivals.
"It's hard to believe we've lost 11 straight here," Giants manager Bruce Bochy said. "Some streaks are tough to explain, and that's one of them. That was hanging over our heads."
Los Angeles knows it missed an opportunity, losing to the Giants in San Francisco for the first time since Aug. 18 last year.
The Dodgers blew a chance to gain a game on the Padres in the NL West and wild-card standings, staying 2 1/2 games back of San Diego in both races after the Padres lost 10-4 at Colorado.
"We have to stay within striking distance of those guys," Dodgers center fielder Juan Pierre said. "We play them next week. We had a chance tonight but we can come back and win the series."
James Loney hit his second solo homer of the game to tie it in the top of the ninth, then Ortmeier answered with his fifth homer of the year, a left-handed shot into the seats in right-center off loser Jonathan Broxton (4-3).
"I rounded third and saw everybody smiling," Ortmeier said. "It was a moment I'll remember and cherish forever. ... In that situation I wasn't thinking home run, no way."
Loney had his second career multihomer game and first since doing it Sept. 28 last year at Colorado. He connected off Brad Hennessey (3-4), who picked up the win after blowing his fourth save.
Pinch-hitter Randy Winn lined a go-ahead single to left in the seventh inning, when the Giants scored three unearned runs to get back into the game.
Bengie Molina homered and Barry Bonds went 1-for-4 with a leadoff single in the seventh. The slugger advanced on shortstop Rafael Furcal's throwing error and scored on Pedro Feliz's RBI single later in the inning. Omar Vizquel followed Feliz with a tying RBI groundout that made it 3-3. Eugenio Velez scored as a pinch-runner in the seventh, his first major league appearance.
Rookie left-hander Jonathan Sanchez struck out five and didn't walk a batter in seven innings for San Francisco, allowing eight hits and three runs. But he got nothing to show for it despite going seven innings for the first time as a professional at any level.
Los Angeles starter Chad Billingsley, who was trying to win his fourth straight start, got Bonds on a called third strike on a 3-2 pitch to end the first, then Bonds grounded out to start the fourth. Billingsley finished with five strikeouts and no walks in six innings, allowing two runs -- one earned -- on five hits.
A few sweatshirt-wearing kayakers in McCovey Cove beyond the right-field arcade hoped for a souvenir home run ball from Bonds, but he never came close to career homer No. 763.
Loney's first homer came in the fifth for the Dodgers, who are finishing up a 10-game road trip this weekend. Matt Kemp had an RBI double and two hits, Pierre singled twice and scored two runs and Russell Martin also had two hits for Los Angeles.
The Dodgers' 11-game winning streak in San Francisco was the team's longest in a road ballpark since getting 13 straight victories at Candlestick Park from Aug. 1, 1976, to Sept. 1, 1977.
"We've been playing well lately," said Loney, who had been scheduled to get Saturday off but might have changed manager Grady Little's mind. "This was a tough loss, but in the big leagues you're going to experience some of those. It's still in our hands."
Pierre gave the Dodgers a 1-0 lead in the first, scoring from third during a rundown with Kemp on a strikeout by Jeff Kent.
After Martin singled with one out in the second, Sanchez retired the next nine Dodgers hitters in order before Loney.
Nomar Garciaparra returned to the Los Angeles starting lineup, three days after coming off the 15-day disabled list. Garciaparra, who went on the DL on Aug. 14 with a strained left calf, batted fifth and went 0-for-4.
Bonds is scheduled to have Saturday afternoon's game off. ... Billingsley got his fifth career hit with a seventh-inning single. ... Nate Schierholtz tripled for the Giants in the third and nearly had an inside-the-park homer before third base coach Tim Flannery called him back after initially sending him home. ... Mark Sweeney received a warm welcome when he returned to San Francisco for the first time since the Dodgers acquired him from the Giants last month. He struck out as a pinch-hitter in the ninth. ... The Giants have all but decided to shut down LHP starter Noah Lowry for the remainder of the season. Lowry, a 14-game winner this year, is nursing a mild strain in his elbow. ... San Francisco brought up Scott McClain from Triple-A Fresno, transferring RHP Vinnie Chulk to the 60-day DL to clear roster room.