Barely three weeks ago, Jayson Werth vowed that changes had to be made for the Washington Nationals to win regularly. Werth never specified what those changes were, but since then the Nationals have certainly played well.

On Thursday night, they won their sixth straight — their longest winning streak since the end of the 2009 season — and did it dramatically. Danny Espinosa's three-run homer in the bottom of the 10th gave the Washington a 7-4 win over the St. Louis Cardinals.

"This has been close to happening for quite some time," Werth said. "We've taken that step to win those games. We've finally got on a roll, and hopefully it keeps going."

Ryan Zimmerman led off the 10th with a single off Fernando Salas (3-1). With one out, Salas hit Michael Morse with a pitch and Espinosa followed by hitting a 2-1 changeup into the bullpen in right. It was his 12th home run of the season, and the first allowed by Salas.

Ian Desmond and Roger Bernadina greeted Espinosa, who had three hits and four RBIs, with a Gatorade bath.

"A couple of weeks ago, I thought we were swinging the bats well. It just wasn't falling for us," Espinosa said. "Our hitting was there. We were just unlucky."

During this streak, the Nationals have had practiced hitting home runs and celebrating. In the three-game sweep of the Cardinals, who have lost six straight, Washington scored 25 runs including eight home runs in the past two games.

"It's that time of year," Nationals manager Jim Riggleman said. "The ball is flying."

Sean Burnett (2-3), Washington's fourth pitcher, threw a scoreless 10th for the win.

The Nationals tagged starter Kyle Lohse for three home runs. In his first 91 innings this season, Lohse allowed five.

Matt Holliday, Albert Pujols and Yadier Molina hit home runs for St. Louis.

"We had a lot of heroics. We missed a couple chances to have a run here or there, but the effort was outstanding," Cardinals manager Tony La Russa said.

St. Louis remains one game behind Milwaukee for the lead in the NL Central. Their six-game skid is their longest since Sept. 10-17, 2008 — when they dropped seven straight.

Holliday led off the second with his seventh homer in his first at-bat since missing 13 games with a left quadriceps injury. Pujols hit his 16th of the season off Tyler Clippard with two outs in the eighth. Molina led off the ninth with his fourth home run of the year off Drew Storen, who blew his second save in 18 chances.

Washington began the first inning with back-to-back home runs from Werth and Bernadina. It's was Werth's 10th of the season — and his third in 12 at-bats against Lohse. Bernadina followed with his second of the season, the second time in as many nights Washington hit consecutive home runs.

After Holliday's homer made it 2-1, St. Louis tied it at 2 in the fourth when Molina's infield out scored Pujols.

Washington took a 3-2 lead in the fourth when Morse doubled with one out and scored on Espinosa's single.

Nix led off the bottom of the sixth with his 10th home run. It landed in the first row of the bleachers in right.

Lohse allowed four runs and seven hits in six innings. He walked one and struck out three.

NOTES: Nationals starter John Lannan pitched seven innings, allowing two runs and six hits. ... Pujols made an error at third base in the ninth inning. He had been moved there from first an inning earlier. It was the third error he committed at third in the last two games. ... Espinosa's ninth-inning miscue ended Washington's franchise-record 130 2-3 innings without an error. ... To make room for Holliday, the Cardinals placed RHP Eduardo Sanchez on the DL with a strained right shoulder. St. Louis has used the DL 13 times this season — the same number as all of 2010. ... Nationals OF Rick Ankiel missed his second straight game because of a strained intercostal muscle. ... Tyler Greene started at SS for St. Louis for the first time since May 25. Ryan Theriot was rested. ... Nationals 1B Adam LaRoche underwent surgery on his left shoulder on Thursday morning. He'll miss the rest of the season, but the team said he should be ready for spring training. ... It was La Russa's 2,499th game as manager of the Cardinals.