WASHINGTON -- The Nationals played small ball for most of the game on Wednesday night, but it was Ryan Zimmerman's home run that proved to be the difference as they edged the Dodgers, 5-4, at Nationals Park.

In the seventh inning, with right-hander Chan Ho Park on the mound, Zimmerman hit a 3-2 pitch over the center-field wall for a home run that gave Washington a 5-3 lead. It was Zimmerman's first home run since May 17 against the Orioles.

"I'm been seeing the ball well and having good at-bats," Zimmerman said. "I'm kind of -- just now -- starting to feel comfortable like I was before. Hopefully, I can run with that for the last month and finish strong."

It was during that series with Baltimore that Zimmerman hurt his left shoulder sliding head first into second base. He would later miss 48 games because of a labrum tear in the shoulder.

After he was activated from the disabled list on July 22, Zimmerman got base hits, but the power wasn't there. It didn't help that he was hit on his right hand by a pitch against the Reds on Aug. 1.

Zimmerman acknowledged that he had to start all over again in terms of getting his power stroke back. It was if he was in Spring Training while opposing pitchers were in midseason form. He said he didn't feel the power coming until a week ago.

"I'm not worried. We have a whole month left. I'll just try to finish strong," Zimmerman said.

Zimmerman's home run turned out to be big because the Dodgers made it a one-run game in the top of the eighth inning against reliever Saul Rivera. With runners on first and third and two outs, Casey Blake singled to left field to score Manny Ramirez.

Vowing to use his closer for more than three outs the rest of the season, manager Manny Acta brought in right-hander Joel Hanrahan to stop the bleeding. It worked, for Matt Kemp ended the inning by flying out to left fielder Willie Harris.

In the ninth, Hanrahan faced four batters and picked up his sixth save of the season. It was his second save in less than a week. Both times, he had to get more than three outs in the game. The first one came last Thursday against the Phillies.

"His demeanor out there, it's getting better," Acta said of Hanrahan. "He is taking a liking to the job. He has done well. I still think he needs to throw a high percentage of strikes because you are not going to get away with having people on base every time you come out and save games. But he has good stuff. ... We still have a month to see him, and we'll see where that takes us."

Earlier in the game, the Nationals got off to a slow start as James Loney and Casey Blake hit solo home runs off right-hander Tim Redding in the top of second inning. By the third inning, however, the Nationals had a 3-2 lead.

In the bottom of the second, Lastings Milledge led off with an infield single off starter Greg Maddux. He then stole second and advanced to third on a groundout by Ronnie Belliard. Milledge then scored on a groundout by Jesus Flores.

In the next inning, the Nationals took advantage of an error made by Maddux. With runners on first and third with one out, Milledge hit a comebacker to Maddux, who threw over Nomar Garciaparra's head as Zimmerman was safe at second. Second baseman Jeff Kent caught the ball and threw to first, but Milledge beat the throw, while Harris scored the tying run.

Zimmerman then scored on a single by Belliard to give Washington the one-run lead.

With Emilio Bonifacio on second in the fifth inning, Harris hit a grounder to Kent at second base. Kent bobbled the ball and Bonifacio scored all the way from second on the play.

"It's nice that we can utilize our speed to our advantage," Acta said. "Bonifacio, man, you know he is going to cause some chaos on the bases as long as he gets on."

Redding lasted six innings and gave up three runs on eight hits. The last run off Redding came in the fifth inning when Andre Ethier hit a solo home run. All three of the homers Redding gave up came on breaking balls, and he was reluctant to throw them after the fifth.

"I'm pleased that we won," Redding said. "If you look at my balls to strike ratio, it probably looks pretty good. I felt it was one of those days I battled and didn't have my best stuff. Actually, I almost turned [into Maddux]. I threw a lot of two-seamers. I'm usually a four-seam guy. I didn't feel I could throw it by them. I got a lot of popups by jamming guys."

Redding picked up his ninth victory, but he couldn't have done it without Zimmerman.