LOS ANGELES -- Timely hitting and the bullpen getting some key outs allowed the Los Angeles Dodgers to escape the Colorado Rockies on Saturday night.

Center fielder Matt Kemp and first baseman Adrian Gonzalez homered and the Dodgers defeated the Rockies 6-3 before a crowd of 45,241 at Dodger Stadium.

Dodgers starter Paul Maholm (1-2) allowed two runs and six hits with three strikeouts and a walk in seven innings for the Dodgers (14-11), who won for only the fourth time in their past six games at home. The victory also allowed Maholm, who threw only 84 pitches (53 strikes), to end a seven-game losing streak to the Rockies (13-12).

"Obviously, with their lineup and with the damage they can do, I really came out aggressive," said Maholm, who picked up his first win as a Dodger. "I was able to throw strikes and get some ground balls, and guys made some great plays. Obviously, putting up some runs makes it a little bit easier to preserve a lead for us. Today, more or less, everything was working."

After reliever Brian Wilson walked catcher Wilin Rosario and Justin Morneau to open the ninth, closer Kenley Jansen retired three of the four batters he faced to register his ninth save.

Colorado right-hander Juan Nicasio lasted just 4 1/3 innings, allowing five runs and eight hits. Nicasio (2-1) struck out four, walked two and hit a batter. He also gave up the home runs to Kemp and Gonzalez, who hit his club-leading eighth of the season and homered for the third straight game.

"Today, I didn't have great command of my fastball," said Nicasio, who entered the game with a 13-inning scoreless streak in his last two outings against the Dodgers. "When I don't have my fastball, I'm terrible."

Yasiel Puig went 2-for-4 and drove in two runs for Los Angeles.

The Rockies threatened in the eighth, loading the bases with one out against reliever Chris Withrow. However, the hard-throwing right-hander struck out Carlos Gonzalez and Troy Tulowitzki to end the inning.

"We ended up having a shot there late," Colorado manager Walt Weiss said. "But they've got some power coming out of that pen. Withrow runs it up there pretty good, so it's a tough at-bat. We had some guys up there and took our shot. All things considered, we were in a position to win that game late, but like I said, it's tough playing from behind against that club."

Rockies second baseman Nolan Arenado, who went 1-for-2 with two walks, extended his hitting streak to 16 games with a single in the sixth.

Colorado scored first on an RBI single by Brandon Barnes that brought home DJ LeMahieu with two outs in the third.

Dodgers manager Don Mattingly won a challenge later in the inning. Barnes initially was ruled safe at first after a pickoff attempt by Maholm. However, after a review, Barnes was called out when replays showed he stumbled back to the bag and was tagged out by Gonzalez.

Dee Gordon tripled to lead off the bottom of the third and scored on a groundout by Hanley Ramirez with one out to tie the score at 1. A sacrifice fly to center by Gonzalez scored Puig for a 2-1 Dodgers lead.

Kemp's solo home run to right just beyond the reach of Barnes made it 3-1.

"I thought he caught it," said Kemp, who hesitated circling the bases before realizing Barnes was unable to make the catch. "He just showed me that he didn't, so I'm happy about that."

Kemp, who has struggled hitting .219 with four home runs and eight RBIs, believes his swing is coming around.

"I got to consistently drive the ball to right field to be successful," said Kemp, who went 2-for-4 at the plate and also stole a base. "It's moving in the right direction."

Puig singled home catcher Drew Butera in the fourth for a 4-1 advantage.

The Rockies, though, got a break in the fifth when Kemp lost a fly ball by Rosario in the lights for a double. Morneau followed with a single to center to score Rosario and cut the Dodgers' lead in half.

In the bottom of the inning, Gonzalez hit a solo shot to left to push the lead to 5-2. For Gonzalez, it was the 1,500th hit of his career.

NOTES: Dodgers SS Hanley Ramirez left Saturday night's game with a bruised thumb and did not return. X-rays were negative. He is listed as day to day, but Ramirez won't play Sunday because Manager Don Mattingly said he already scheduled Ramirez to take the day off. ... The two clubs ranked first and second in the National League in extra-base hits entering Saturday's game. Colorado had 85 compared with 81 for Los Angeles.