Ellis, who drove a 0-1 slider from Giants closer Sergio Romo into the left-center field gap, provided the biggest hit in a game otherwise dominated by the starting pitchers.
Clayton Kershaw went eight innings for the win, giving up one run and three hits. Giants starter Chad Gaudin gave up one run and four hits while striking out nine in seven innings.
Yasiel Puig led off the top of the ninth inning with a single off of Romo, and advanced to third base on an Adrian Gonzalez single and error by first baseman Buster Posey. After getting Hanley Ramirez to ground out, Romo walked Andre Ethier intentionally and struck out Juan Uribe before the Ellis at-bat.
The Dodgers struck first in the top of the second inning. Ramirez led off with a triple that extended his hitting streak to a career-long 18 games. Ethier then singled Ramirez home.
The Giants answered in their half of the third inning, when a sacrifice fly off the bat of Andres Torres scored Guillermo Quiroz.Copyright © 2015, The Baltimore Sun