After striking out on three pitches with the bases loaded in the third inning, Ramirez hit a three-run homer and a two-run double in his next two at-bats, leading the Dodgers to a 7-2 victory over Brandon Webb that gave them sole possession of first place in the NL West for the first time since April 4.
"He was just setting them up right there," teammate Russell Martin said with a smile. "He got them the next time around. I need to learn that."
Martin and Andre Ethier, the first two batters in Los Angeles' lineup, drew three walks each to help give Ramirez the opportunities to come through in the clutch.
"They're walking us to get to Manny," Martin deadpanned.
Chad Billingsley took a shutout into the seventh for the Dodgers, who won their seventh straight after an eight-game skid to move a half-game ahead of Arizona entering Sunday's finale of their three-game series -- the last regular-season game between the teams this season.
"We got hammered two days in a row here and have lost the last four to them, so we need to respond tomorrow," said Diamondbacks manager Bob Melvin, whose team has dropped nine of 12. "There's no doubt. We'll see what we're made of tomorrow. We've been in first place for quite a while. Now it's our turn to respond tomorrow and take it back."
The Diamondbacks had either held or shared first place since April 5.
After being outscored 54-15 during their losing streak, the Dodgers have outscored the opposition 47-15 in their seven consecutive wins.
"We've been on the other end of this thing," manager Joe Torre said. "The teams that handle the bad spells the best usually come out on top."
Regarding his team's first-place standing, Torre said: "It doesn't count until the last game of the season. A week ago yesterday, we were five games out in the loss column. We've come a long way in a short time."
Webb (19-7), who issued a career-high six walks while failing in his third attempt to reach 20 wins for the first time, walked Ethier with a runner at second and two outs in the fifth in a scoreless game. Ramirez hit the right-hander's first pitch into the right-field pavilion to give the Dodgers all the offense they would need.
Ramirez had left the clubhouse by the time reporters reached his locker after the game, but his manager and teammates spoke for him.
"Manny gets up there: strike one, strike two, strike three with the bases loaded. And then, bang," Torre said.
"He's been doing that his whole career," Billingsley said. "One swing of the bat, he can change the game, the momentum. He just brings so much energy, so much life, it just relaxes all of us."
Ramirez has 521 homers, good for a tie with Ted Williams, Willie McCovey and Frank Thomas for 17th on the career list, and 1,706 RBIs, putting him 20th. Ramirez has 11 homers and 34 RBIs in 34 games for the Dodgers since being acquired from Boston on July 31.
"He's a very dangerous hitter and he makes the guys that hit in front of him and behind him that much better," Webb said. "He's just real aggressive and doesn't miss many pitches. He brings excitement to the clubhouse and gets the fans in it, which gets the team excited. He's been a big help to them so far."
Ramirez came up with the bases loaded again in the sixth, this time against Juan Cruz, and again hit a fly to deep right. Justin Upton lost the ball in the sun, and it landed on the warning track before bouncing into the stands for a ground-rule double.
"I had my glasses on the whole time," Upton said. "It was a tough ball. I saw it off the bat and I had to get to a spot, but it went straight up in the sun and it was so high it just never came out."
Webb, trying to become the NL's first 20-game winner since 2005, allowed five hits and seven runs in 5 2/3 innings while striking out six. He has issued 11 walks in his last two starts -- both against the Dodgers. That's one more than he had in his previous seven starts combined.
The Dodgers have beaten Arizona aces Webb and Dan Haren twice each during their winning streak. Webb and Haren are 3-5 against the Dodgers this season and 30-9 against everyone else.
Billingsley (14-10) allowed four hits in 6 1/3 innings while walking one and striking out nine. He was relieved by Cory Wade with the bases loaded in the seventh, and Wade got Upton to ground into an inning-ending double play.
Dodgers RHP Greg Maddux, a winner of 354 career games, was originally scheduled to face LHP Randy Johnson, a 294-game winner, in Sunday's game. Instead, it will be 20-year-old LHP Clayton Kershaw (3-5) going against 24-year-old RHP Max Scherzer (0-2). Torre thinks Kershaw matches up well against the Diamondbacks, while Johnson was scratched because of a sore left shoulder. ... Torre said he thinks five injured players -- 2B Jeff Kent, SS Rafael Furcal, RHP Brad Penny, OF Andruw Jones and RHP Takashi Saito -- all have a good chance to return before the end of the season.