Ramirez singled twice off loser Mike Pelfrey but also was called out on strikes twice by plate umpire John Hirschbeck, who ejected Ramirez after he tossed three pieces of equipment, his arm protector landing closest to the umpire. It was the fifth ejection of Ramirez's career.
Meanwhile, Kershaw allowed three hits and struck out seven in six scoreless innings for his third consecutive win.
"I thought he was terrific," Dodgers manager Joe Torre said. "The last three or four outings, since he was waxed in the three-inning start [June 10], he's come back and really been more of a pitcher."
Kershaw has allowed only two runs in his past five starts covering 29 2/3 innings and the Dodgers have won each game. He made 101 pitches and was lifted for pinch-hitter Blake DeWitt, who homered.
"There have still been ups and downs, but, obviously, the results have been better," said Kershaw, who for the first time has a winning record at 6-5. "I still need to cut down on walks. Six innings, I still made 100 pitches. But I can't help but be happy with the results."
The struggling Mets have lost nine of their past 11, scoring three runs in the past four games.
"The way we're playing, there's definitely a difference between what they have and what we have," Mets manager Jerry Manuel said.
"It's simple," said Mets third baseman David Wright. "You don't pitch, you don't hit, you don't play defense, you don't win."
The Dodgers did all of that, especially pitching, as Kershaw combined with James McDonald, Claudio Vargas (in his Dodgers debut) and Guillermo Mota for the staff's sixth shutout, a four-hitter.
"Kershaw was a little surprised when he came out," Torre said. "But we have that marker when he gets to 100 pitches."
Catcher Russell Martin said the 21-year-old Kershaw is showing his maturity as a pitcher with increasing consistency.
"He has more consistent mechanics with the same effort on every pitch," Martin said. "He's not trying to do too much. He'll overthrow, but you see less and less of that. He has a better feel for his pitches."
Of his seven strikeouts, five third strikes were on curveballs.
"It feels like he's winning battles," Martin said. "He still goes deep in counts, but with that kind of stuff and the life on his fastball, he gets a lot of swings and misses. When he can throw the curveball for strikes, he's going to have a good day. And his fastball, he's pounding with both sides. The ball is staying true, it's not cutting and drifting. Sometimes he gets in a funk, but today, he had consistent backspin and that also makes the changeup better."
Kershaw said the early lead helped.
"It relaxes you to the point where you know one pitch won't be a game-changer," he said. "You just go after them. For me, pitching-wise, I don't change anything. Stay aggressive and make them beat me with hits instead of walks."
The Dodgers' offense was only 2-for-9 with runners in scoring position and stranded 13 runners.
In addition to Ramirez's two hits and three RBIs, the Dodgers also got two hits and two RBIs from All-Star Orlando Hudson, coming off a benching to end an 0-for-22 slump.
Matt Kemp, on the 2009 All-Star Game Sprint Final Vote ballot, had two hits, walked with the bases loaded and threw out a runner at third base from center field.
Ken Gurnick is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.