Ramirez, who didn't start for the second straight day because of tightness in his right calf, drove a 1-2 pitch from right-hander Sergio Romo (0-1) into the left field pavilion with one out after Barry Zito walked pinch-hitter Garret Anderson.
The homer tied Ramirez with Mike Schmidt for 14th place all-time.
Ramon Troncoso (1-0) retired Juan Uribe on a fielder's choice grounder with the bases-loaded to end the eighth to get the victory. Jonathan Broxton pitched a perfect ninth to convert his first save opportunity of the season.
The Dodger series is the first losing one for the Giants this season. Many on the team would tell you they were thinking about their friend and teammate Aron Rowand Sunday and not the loss.
Rowand was hit in the face by a pitch on Friday night and was placed on the 15 DL.
But at the end of the day the news was good about Rowand's trip to the Bay Area Sunday. Doctors decided he would not need surgery, according to Comcast Sports. That means he will likely rejoin the team in San Diego as early as Monday. He'll still be on the DL, but he will be able to practice and stay with his teammates.
Rowand fractured the same bone he broke when making a catch at Philadelphia's Citizens Bank Park in 2006. He crashed into the center-field wall, breaking his nose and bones around his left eye. That also put him on the 15-day disabled list.
Rowand didn't go on the disabled list easily, but was overruled by medical staff. He is sporting some facial bruises. He said he's still not sure whether the ball or his helmet hit him in the face. The helmet shattered.
"In their thoughts, it wasn't the wise move to try to continue playing with the fractures in my face," Rowand told MLB.com.
Rowand told reporters all weekend he feels fine.