"He makes us so much better when he's in the lineup," Clayton Kershaw said of the shortstop, who went 4-for-5. "It's amazing the impact he has. He's one of the best, a special talent."
But right in line with the rest of the season, Ramirez left the game early when he felt the nerve in his back send pain into his hamstring trying to leg out a ninth-inning grounder.
"I'm not 100 percent, but we got to get this thing over and win the division," he said of his insistence on playing with pain. "If the playoffs start tomorrow, I'd be ready to play."
The Dodgers also got a stunning game-winning home run from A.J. Ellis, one big blast helping to rehab an offensive struggle that had seen him hit .192 in the second half.
They overcame a disappointing outing by fourth starter Ricky Nolasco, who blew a three-run lead, by adding three RBIs from the bottom of their order to Ramirez's four and nursing four crucial innings from a weary bullpen.
"It was a microcosm of our season," manager Don Mattingly said.
Nolasco has given the Dodgers back-to-back poor starts after winning seven straight. This time, Ramirez gave him a three-run homer to work with and Nolasco responded by allowing a career-worst six runs in the bottom of the third.
With the bullpen shorthanded, Mattingly left Nolasco out there and he rebounded with two scoreless innings.
"I felt like after three [innings], Ricky started to protect the lead and lost his aggressiveness," said Ellis. "He got it back the last two innings. In hindsight, we should have been more aggressive."
Sort of like Ellis was when he shot a Josh Collmenter pitch over the left-field fence leading off the eighth inning to break the 6-6 tie.
"Last night I went back to the hotel and I thought to myself that I really wanted to be a contributor today, to do something special," said Ellis, who had three hits.
Ellis also complimented the bullpen. J.P. Howell got the victory in relief after a crucial 1 1/3 innings of scoreless pitching from former closer Brandon League. Brian Wilson (0.87 ERA) pitched the eighth and Kenley Jansen the ninth for the career-high 26th save.
"I'm happy for Brandon, who has fought the battle all year and gets us four big outs," said Ellis. "Brian Wilson gets better and better every time. And Kenley has never been nastier. He was on a mission today.
"Give the Diamondbacks credit. They defended their turf. We took what we came for. We didn't want to scoreboard watch. We wanted to do it on the field."
Ramirez started a premature celebration in the third inning when he launched a three-run homer off Arizona starter Wade Miley, turning to the dugout for affirmation as he began his trot toward first base, more than making up for Yasiel Puig's baserunning mistake that preceded Ramirez's 19th homer.
Puig's mistake was another in a series on the bases. Miley walked Nolasco and Puig to open the inning before Jerry Hairston hit a popup behind first base. Puig didn't move off first base when he should have gone halfway to second, which would have allowed him to advance when the ball dropped.
Instead, he was easily thrown out at second by right fielder Gerardo Parra. Hairston's annoyed body language showed the frustration the Dodgers have with Puig, who still hasn't learned the game despite his immense talent.
Meanwhile, Nolasco wasn't fooling anybody. He got away with allowing baserunners the first two innings, but the roof caved in again on him in the third, as Arizona scored six runs on seven hits, four for extra bases with nobody throwing in the bullpen. Martin Prado tripled (with Puig fumbling the ball in the corner) and there were doubles from Paul Goldschmidt, Gerardo Parra and even Miley.
Nolasco has started back-to-back flops. He allowed seven runs (five earned) on seven hits and three walks to San Francisco and six runs on nine hits in five innings to the D-Backs after reeling off seven consecutive wins. He also hit Goldschmidt and Prado with pitches, resulting in warnings to both benches by plate umpire Jim Joyce, the controversial figure from the previous night who apparently wanted no replay of the June 11 brawl between the clubs.
The Dodgers came back in the fifth. Juan Uribe and Scott Van Slyke doubled for one run, Ellis singled Van Slyke to third and pinch-hitter Michael Young's sacrifice fly scored Van Slyke. Ramirez's seventh-inning home run tied the game.