The Dodgers, who once languished in last place 9.5 games out, snapped a four-game skid and can clinch the division title by beating Arizona.
Greinke (15-3) allowed two runs and six hits in six innings to improve to 7-0 in his last nine starts.
Patrick Corbin (14-7) gave up six runs and seven hits in two innings plus three batters, his shortest outing of the year. After starting the season 12-1, Corbin is 2-6 in his last 10 starts.
Aaron Hill hit a solo home run for the Diamondbacks.
Hanley Ramirez, who had missed the Dodgers’ previous four games with a sore back, reached base four times with a single and three walks and scored three runs.
In other NL action, it was:
‧ Phillies 6, Marlins 4
‧ Giants 8, Mets 5
‧ Brewers 4, Cubs 3
AP, ST PETERSBURG, Florida
Ian Kinsler and Elvis Andrus homered and drove in three runs each as the Texas Rangers snapped a seven-game losing streak with a 7-1 victory over the Tampa Bay Rays on Tuesday.
The Rangers pulled even with the Rays at the top of the AL wild-card race.
The Rangers, who held the No. 1 wild-card spot or the AL West lead for most of the summer, won for only the fourth time in 17 games.
Kinsler hit Jeremy Hellickson’s first pitch for his 12th home run, breaking a streak of seven homerless games for the Rangers, their longest in 23 years. The 1-0 lead marked the first time Texas have led in a game since Sept. 8.
Kinsler added a two-run single in the Rangers’ four-run third, driving in three runs on the first two pitches he saw from Hellickson (11-9). Andrus followed with his third home run of the season to put the Rangers up 5-0.
Alexi Ogando (7-4) won in his first start since Aug. 13, giving up two hits in five innings
ORIOLES 3, RED SOX 2
In Boston, Danny Valencia tripled to stop closer Koji Uehara’s streak of 37 consecutive outs, while pinch-runner Alexi Casilla scored on Matt Wieters’ sacrifice fly in the ninth inning to lift Baltimore over Boston.
The Orioles overcame a 2-0 deficit on Brian Roberts’ run-scoring groundout in the fifth and Chris Davis’ 51st homer of the season in the sixth that tied the score 2-2. Davis broke the club record set by Brady Anderson in 1996.
Uehara (4-1) fell four outs short of Bobby Jenks’ major league record for a reliever of 41 consecutive retired batters set in 2007 and Mark Buehrle’s mark for all pitchers of 45 in 2009. The run was the first off Uehara in 30-2/3 innings and ended a streak of 27 scoreless outings since July 9.
TIGERS 6, MARINERS 2
In Detroit, Michigan, Miguel Cabrera homered, while Austin Jackson hit a two-run single as Detroit held off Seattle, despite a short-handed bullpen.
The AL Central-leading Tigers were ahead 3-2 when they escaped a bases-loaded jam in the eighth while playing without closer Joaquin Benoit and left-handed reliever Drew Smyly. They were both given the night off.
Anibal Sanchez struck out 10 in 6-1/3 innings, but the Mariners tied it at 2 against him in the seventh, forcing Detroit’s relievers into action. Al Alburquerque (3-3) got out of the seventh, and Phil Coke and Jose Alvarez made it through a dodgy eighth. Alvarez got two outs in the ninth, and Jose Veras finished.
Yoervis Medina (4-6) took the loss.
BLUE JAYS 2, YANKEES 0
In Toronto, R.A. Dickey pitched seven innings to win his fourth straight decision, while Colby Rasmus and Rajai Davis homered as Toronto handed slumping New York their fourth straight loss.