Los Angeles exploded for seven runs in the eighth inning and won for the fifth time in their last six contests.
John Ely (1-1) earned his first career victory with two runs, six hits and six strikeouts in six-plus innings.
Kelly Johnson drove in two of Arizona's three runs. Chris Young accounted for the other run.
Dan Haren (4-2) struck out 10 but took the loss after surrendering four runs on 10 hits over 6 1/3 innings.
The Dodgers took a 4-0 lead into the seventh inning when Arizona tallied all three of their runs on Young's RBI single and a two-run double by Johnson.
Los Angeles exploded for seven runs in the eighth with Martin's three-run homer being the big blow. The Dodgers padded the lead in the ninth on a two-run single by Jamey Carroll.