WASHINGTON -- Nationals manager Dusty Baker walked off the field, then raised his right arm to fans behind Washington's first base dugout.
It was also the 1,700th managerial win for Baker, who first made up a lineup card in 1993 with the San Francisco Giants.
"It means I have been around a long time," said Baker, with a grin. "I give orders better than I take them. I am just happy my daughter was here."
Baker has a career mark of 1,700-1,523 and is second among active managers in wins behind Bruce Bochy of the Giants, who has 1,732.
A former big league outfielder from California, Baker is 17th on the all-time managerial victories list. He noted his first win as a manager came against the Cardinals.
He can thank two of his hitters who snapped out of slumps with solo homers for the milestone victory.
Danny Espinosa, batting .199 at game time, hit a solo homer to right with one out in the seventh to break a 1-1 tie.
Bryce Harper, hitless in his previous 10 at-bats on the homestand, tied the game at 1-1 with a long solo homer to right in the sixth.
"It felt good. I got a pitch I could handle," Harper said.
Said Baker: "A monster home run."
It was the 12th homer of the year for Harper and his first since May 13.
One inning later Espinosa went deep for his fourth homer and first since May 11.
Both homers came off Reds starter Mike Leake (3-4), who gave up just the two runs in seven innings. He allowed seven hits and one walk while striking out five.
"He pitched a heck of a game, besides the home runs," Baker said of Leake.
Said Cardinals skipper Mike Matheny of Leake: "He was great. We needed a solid start, and he gave it to us. A couple of solo home runs shouldn't be enough to do that to us, but we just had trouble making anything happen offensively."
The winner was Joe Ross (4-4), who yielded one run and six hits with four strikeouts in seven innings.
"He was great," Matheny said of Ross. "He kept us off balance and didn't let us string anything together."
Felipe Rivero threw a scoreless eighth for Washington. Jonathan Papelbon, pitching for the first time since May 20, tossed the ninth for his 13th save.
Anthony Rendon had two hits for the Nationals, and he has reached base 18 of his past 20 games.
Ross got nine outs from the first 10 batters he faced before Aledmys Diaz led off the fourth with a solo homer to give the Cardinals a 1-0 lead. It was the seventh homer of the year for the rookie shortstop, who never hit more than 13 in one minor league season.
The first-place Nationals (29-19) improved to 14-9 at home. St. Louis (24-24) slipped back to .500 for the first time since May 8.
NOTES: Cardinals 1B Matt Adams left the game in the fifth inning with mid-back stiffness. He will be evaluated Friday. Randal Grichuk entered in center field, Jeremy Hazelbaker moved from center to left, and Brandon Moss shifted from left to first base. ... Virginia McLaurin was recognized before Friday's game on Black Heritage Night. She is 107 and gained internet fame when she danced with President Obama. Washington manager Dusty Baker presented her a Nationals jersey with the No. 107 on the back, and she did a little dance near the Washington dugout. She was born on March 12, 1909, in South Carolina, a few months before the Pittsburgh Pirates beat the Detroit Tigers in the World Series.