AP photo by John Bazemore / Atlanta Braves shortstop Dansby Swanson catches a fly ball hit by the Washington Nationals' Josh Harrison during the first inning Wednesday.

ATLANTA — Jon Lester wasn't worried about pitching on short rest for the Washington Nationals. His strong outing was well-timed for a team that again has lost Stephen Strasburg to an injury.

Yan Gomes hit a go-ahead home run in the eighth inning, and Lester gave the thin rotation a boost as the Nationals beat the Atlanta Braves 5-3 on Wednesday night.

Lester, starting on three days' rest, was asked by Washington manager Dave Martinez to "just take us as long as he can go." Lester came within one out of matching his longest start of the season as he gave up only one run on five hits and two walks in 5 2/3 innings.

"I basically told him just tell me when I'm pitching and I'll be there," Lester said. "That's kind of how I've always looked at it."

Lester's start was especially important after Strasburg was placed on the 10-day injured list with a neck strain before the game. Strasburg previously was on the 10-day IL from April 15 until May 21 with right shoulder inflammation.

"He was really good. Really good," Martinez said of Lester. "He gave us everything we needed."

Lester faced no limitations.

"I said, 'Hey, if we're going to do this, I don't want to be on a pitch count,'" Lester said. "I just wanted it to be a normal start."

Gomes' drive to left-center off A.J. Minter (1-2) with two outs in the eighth broke a 3-all tie.

Juan Soto's two-run homer in the fifth gave Washington a 3-1 lead. Ozzie Albies' two-run double in the seventh tied the game.

Dansby Swanson's homer to right-center tied the game in the second and gave him an 11-game hitting streak, matching the longest of his MLB career. The homer was his ninth this year; career high was 17 in 2019. He narrowly missed a second homer in the sixth when his long fly was caught at the left-field wall by Kyle Schwarber.

"I think they changed the ball on me on the second one," Swanson said with a laugh.

Washington right-hander Tanner Rainey gave up a double to pinch-hitter Abraham Almonte to open the seventh. Rainey struck out pinch-hitter Pablo Sandoval and Ronald Acuña Jr. before walking Freddie Freeman.

Albies' double to the wall in right-center off Daniel Hudson (4-1) drove in Almonte and Freeman to tie the game. Hudson remained in the game to pitch a perfect eighth.

Brad Hand worked the ninth for his ninth save in 11 chances this season.

Trea Turner's single off Chris Martin in the ninth drove in Victor Robles and pushed the lead to two runs.

The Braves (25-28) fell three games under .500.

"Like I've said before, we haven't been able to hit on all cylinders," manager Brian Snitker said. "It's up to us as a club to keep it going, because believe me, it's going to happen."

Drew Smyly allowed three runs on seven hits and two walks in 4 1/3 innings.

Atlanta right-handed pitcher Edgar Santana favored his right leg leaving the field but apparently avoided an injury when he was hit by Josh Harrison's liner in the seventh. Santana threw out Harrison.

Braves outfielder Cristian Pache (right hamstring strain) was activated from the 10-day IL and optioned to Triple-A Gwinnett. Pache was hitting only .111 before the injury.

"He needs to play every day," Snitker said. "He needs to hit."

Left-hander Patrick Corbin (3-4, 6.23 ERA) will start for the Nationals on Thursday afternoon in the finale of the four-game series.

Sticking with his season-long plan to give starters an extra day of rest when possible, Snitker pushed back right-hander Ian Anderson one day to Friday night's series opener against the Los Angeles Dodgers. Snitker announced after Wednesday's game that left-hander Tucker Davidson will be recalled from Gwinnett to make his second MLB start of the season.