The Nationals fell to 20-20 on the season, and dropped to third place in the National League East standings. Washington now trails Philadelphia by five games and second-place Florida by one game. The Braves are a half-game behind and the last-place Mets are just one game back of the Nats.
"I think it probably indicates how we have played," manager Jim Riggleman said of their record. "I think we've played better than .500, but we haven't hit better than .500. We've pitched really good for about three weeks now it seems like. We just have to try to hold the fort with our pitching until the runs start coming."
Lannan produced one of his best starts of the season. The left-hander allowed just two runs on five hits over six innings.
"He pitched good," Riggleman said. "I'm really encouraged that he was out there and pitched in that 100-pitch range pain-free. He's kind of had an issue or two. We bumped him a start and all that kind of stuff and that's one of the better games he has thrown this year for us."
Lannan, who said his arm felt great, made just one mistake, a pitch in the third inning that St. Louis shortstop Felipe Lopez hit over the center-field wall for a two-run home run and an early lead for the Cardinals (23-17).
"Lannan pitched a great game," Lopez said. "He just made one mistake, and that was it. He was trying to throw that slider in, and he kind of left it over the plate."
Washington got a run back in the fifth inning when catcher Wil Nieves smacked a solo home run to left field, his first of the season and third of his career in 219 at-bats.
The Nationals tied the score at 2 in the eighth inning when rookie shortstop Ian Desmond came through with a clutch two-out RBI single up the middle against Cardinals starter Chris Carpenter (5-1).
"That was a great at-bat," Riggleman said. "Carpenter was out there battling through eight innings and just really still had good stuff. He was throwing 93 miles per hour in the eighth inning and always has the good breaking ball. ... You don't know what pitch you're going to get and Desi just battled him and took some pitches off the plate and got a pitch to hit and took advantage of it."
But the Nationals couldn't keep the Cardinals down.
Reliever Tyler Clippard, making his 20th appearance of the season, surrendered a solo home run to Ryan Ludwick to left field in the bottom of the eighth inning.
"It was a terrible pitch," Clippard said. "Cutter, trying to go away and I threw a nice little cement mixer up there for him -- middle in -- and he hit it out."
Clippard (7-3) took a loss for the third time in his past four appearances.
"I'm just not pounding the zone like I need to," he said. "My stuff is there. It's just a matter of execution and command. It just hasn't been there the last couple outings. It's just one of those things. No explanations for it."
The Nationals return home for a five-game homestand, with two games against the Mets and then three in Interleague Play against the Orioles.
"I think if we get home and get a couple wins we'll be back where we were before we lost a few in a row," left fielder Josh Willingham said. "In a 162-game season, you're going to lose a few in a row. It's just the way it is. You want to make it end as quickly as possible."