SAN FRANCISCO -- On a beautiful afternoon in a stadium in which he loves to play, Los Angeles Dodgers catcher A.J. Ellis enjoyed the type of game he dreams about Sunday.
After Dodgers ace Clayton Kershaw made it easy on Ellis for eight innings, San Francisco Giants closer Sergio Romo did the same in the ninth. The latter was not by design.
Ellis smacked a hanging slider from Romo to the wall in left-center field with two outs and the bases loaded in a 1-1 tie, driving in three runs and delivering the Dodgers a 4-1 victory over the Giants at AT&T Park.
The victory allowed the Dodgers to win the series between National League West rivals 2-1 and run their record to 4-2 on their current road trip. Surging Los Angeles has won nine of its last 11 games against NL West competition.
"Today was huge," Ellis claimed of the Dodgers' fifth win in the last six games against the Giants. "We need to keep winning series."
Having surged into second place in the West, the Dodgers now head to Arizona for a three-game duel with the division-leading Diamondbacks. Los Angeles manager Don Mattingly stamps his team ready.
"We're a confident bunch right now," he said of a club that hasn't lost a series since leaving Yankee Stadium in mid-June. "We feel like we're going to win when we play a game like this. That's changed from earlier in the season."
Yasiel Puig, who had struck out in six of his previous seven at-bats against Giants pitching, hit Romo's third pitch of the ninth into left-center field for a single to ignite the decisive uprising.
Adrian Gonzalez followed with a one-hopper that Buster Posey, playing first base, tried to backhand, but the ball kicked off his glove. When the Giants' All-Star threw errantly in a belated attempt to get Puig at second, the rookie sensation raced to third.
Following an infield out and an intentional walk to Andre Ethier to load the bases, Romo (3-4) struck out the hero of the Dodgers' win Friday night -- Juan Uribe -- before Ellis stepped to the plate and smacked his difference-maker between Giants outfielders.
"The great thing about the Dodgers and the Giants, there are no secrets," Ellis said of his familiarity with Romo. "You know about his bread and butter -- his slider. Fortunately, it was a ball I could hit."
The three RBIs ran Ellis' season total to 23.
"It's so much fun to play here," he said of AT&T Park. "The energy of the fans, it keeps you focused. There's just a small band of us against the whole stadium. I enjoy being the underdog."
Kershaw (8-5) continued his mastery of the Giants, especially in San Francisco, by allowing just one run in eight innings. He walked one and struck out three before turning the ball over to Kenley Jansen, who recorded his ninth save by pitching a one-hit ninth.
Kershaw entered the game with the lowest ERA (0.74) in the history of AT&T Park for visiting pitchers who have made at least five starts there. That mark went up only slightly to 0.79 in his third consecutive victory over the Giants this season.
"It's just a great park to pitch in," he said. "The fans are great here. I just like it here."
Selected to his third consecutive All-Star team Saturday, Kershaw lowered his major-league-best ERA to 1.89. He was coming off a complete-game shutout in an 8-0 win at Colorado on Tuesday.
He recognized he would not have gotten his eighth win without Ellis' hit.
"That was huge. We need to win games like this," Kershaw said. "Tight games like that, we're going to need a clutch hit. A.J. came through."
The Giants have lost 11 of their last 13 games. They entered the contest averaging a major-league-low 3.1 runs per game since June 1.
Giants right-hander Chad Gaudin, making his first start since getting hit by a line drive near the right elbow against the Miami Marlins on June 20, matched Kershaw pitch for pitch before being pulled after seven innings of four-hit ball. He was activated from the disabled list prior to the game.
Gaudin threw just 92 pitches in his seven innings, walking one (intentionally) and striking out a season-best nine. He allowed one run.
"You're going to go through stretches like this," he said of the Giants after noting he was not surprised by his comeback effort. "Everybody's got to pull together. I think we're doing that."
The teams traded early runs to result in the 1-1 tie that lasted until the ninth. Los Angeles' Hanley Ramirez tripled and scored on an Ethier single in the second. Guillermo Quiroz, who had doubled, scored for the Giants in the third on a sacrifice fly from Andres Torres.
Ramirez's triple extended his hitting streak to 18 games.
NOTES: The Dodgers were without CF Matt Kemp for the second consecutive game because of a left shoulder injury suffered in the series opener Friday. Kemp is expected to be back in action for the opener of the Arizona series Monday. ... RHP Ricky Nolasco, acquired Saturday from the Marlins, has been slated to start for the Dodgers on Tuesday night in the second game of the Diamondbacks series. LHP Chris Capuano, who gave up 13 runs on 17 hits in his last two starts, was demoted to the bullpen. ... To make room for RHP Gaudin on the active roster, the Giants send LHP Mike Kickham back to Triple-A Fresno. Kickham had a 12.50 ERA in three appearances, including two starts. ... The Giants will face an All-Star for the second consecutive day when RHP Matt Harvey pitches for the New York Mets in the opener of a three-game series in San Francisco on Monday night.