WASHINGTON (AP) -- Gio Gonzalez loves how the Washington Nationals are playing right now, and it's easy to see why.
Gonzalez pitched seven crisp innings and Washington slugged three homers in a 9-0 victory over the sliding Miami Marlins on Thursday night.
''We're getting our groove back,'' Gonzalez said. ''I think that you can see it live, and the chemistry in here is just getting better and better. I think it's the music choice. I don't know what it is, but I think that our guys out there are having more fun up there at the plate.''
Jayson Werth and Ian Desmond each hit a three-run homer as Washington won for the eighth time in its best nine-game stretch of the season. Bryce Harper also went deep to help the Nationals pull within 6 1/2 games of idle Cincinnati for the second NL wild-card slot.
Gonzalez (8-6) allowed three hits and struck out eight in his first victory in six weeks. The left-hander, who was 0-3 with a 5.94 ERA in his previous seven starts, retired his last 11 batters.
The Nationals (68-65) were six games under .500 on Aug. 6, and now they're three games over for the first time since July 10 thanks to their hot offense.
''We're a scary team when we're going good, and I think everybody knows that,'' Harper said.
Ryan Zimmerman sparked Washington's offense with a leadoff walk in the fourth. Harper drove Tom Koehler's next pitch over the wall in left for his 19th homer, extending his career-best hitting streak to 11 games.
Nationals manager Davey Johnson said Harper has adjusted his batting stance.
''He's a little more upright,'' Johnson said. ''There's not so much tension. When you get down in a little crouch, there's a little more tension that builds up.
''He looks more relaxed.''
Zimmerman, who went 3 for 3, led off the sixth with a base hit and Harper walked before Werth belted a drive to left for his 21st homer.
Desmond had the last homer of the night, a 1-2 shot to left with two out in the seventh for his 20th of the season. Zimmerman was thrown out at the plate when he tried to score on Werth's single before Desmond went deep.
Adeiny Hechavarria had two of Miami's four hits in its eighth loss in nine games - matching its worst nine-game stretch since May. Koehler (3-9) allowed six runs and seven hits, walked four and struck out one.
Gonzalez gave Washington's bullpen some much needed rest.
Although the Nationals swept Miami, their first two starters didn't go deep. Stephen Strasburg pitched just three innings Wednesday due to a rain delay, and Ross Ohlendorf threw five-plus innings in the series opener.
Gonzalez walked three hitters in the first two innings before returning to the locker room to change his jersey. Inside, Rafael Soriano advised Gonzalez on his mechanics, and the starter said the message turned his outing around.
''If you would have told me I was going seven, I would have laughed in your face in the second inning,'' Gonzalez said.
The Marlins have drawn 34 walks in their last 10 games, and none of the runners have scored. Miami has scored three or fewer runs in each of its last eight games, averaging 1.6 runs in that stretch.
''We did hit some balls hard, right at some guys, I guess, if you're trying to find a couple positives,'' Miami manager Mike Redmond said. ''But really, at the end of the day, we didn't pitch well tonight, we didn't hit and we got beat.''
Denard Span matched a career-best 12-game hit streak with his first-inning single, and Werth finished with three hits.
NOTES: The Marlins optioned RHP Arquimedes Caminero to Triple-A New Orleans and recalled RHP Sam Dyson from their top farm club. Caminero had a 2.25 ERA and a blown save in four games with Miami. Dyson was 1-3 with a 2.61 ERA in five starts for the Zephyrs and will fill a long-relief role with the Marlins. ... Johnson marveled at the inexperience of Strasburg, who's in his fourth season. During Wednesday's delay, pitching coach Steve McCatty worked with Strasburg. ''(McCatty) said, 'Just relax. You've been in this situation,''' Johnson said. ''(Strasburg) said, 'No, I haven't.' He was shocked.'' ... Marlins 2B Donovan Solano hit leadoff for just the second time this season and first time since April. ''We're at a point in the seasons where we have a chance to try different things,'' Redmond said. ... A batted ball hit Miami RHP Ryan Webb in the back while he stretched on the field during the Nationals' batting practice. Webb fell to the ground, and Redmond asked Jose Fernandez why he was laughing. ''He gets hit every time,'' Fernandez said. ''We go anywhere, he gets hit.'' Webb left the field with a trainer, and a Miami spokesman said Webb had a bruised back.