WASHINGTON -- As a boy, Davey Johnson was a batboy for the old Washington Senators during spring training at Tinker Field in Orlando.
On Sunday, the Nationals manager said goodbye to the home fans as Washington gained a doubleheader split in dramatic fashion with a walk-off win in the nightcap of a doubleheader, the last home date of the regular-season schedule in the nation's capital.
Third baseman Chris Coghlan's ninth-inning error scored pinch runner Eury Perez, giving the Nationals a 5-4 win over the Miami Marlins in the second game.
"That was an interesting way to close the homestand. It was fun. It was emotional," said Johnson, who is stepping down as the Nationals' manager after the season.
Johnson was honored before the first game Sunday with video tribute that included greetings from Hall of Famers Jim Palmer and Cal Ripken Jr.
"Davey means a lot to all of us in here," Washington shortstop Ian Desmond said of Johnson, a former second baseman for the Baltimore Orioles, Atlanta Braves, Philadelphia Phillies and Chicago Cubs. "He has brought out the best in all of us."
Johnson managed the Mets to the 1986 World Series title and also guided the Orioles, Los Angeles Dodgers and Cincinnati Reds.
Miami won Sunday's first game 4-2, damaging the Nationals' minuscule playoff hopes. Washington (84-72) sits five games back of the two National League wild-card leaders, the Cincinnati Reds (89-67) and Pittsburgh Pirates (89-67), with six games to play.
"It is huge for us to finish strong," said Stephen Strasburg, Washington's starter in the nightcap.
"I know we had the chance to be spoiler here with these guys trying to make a push at the playoffs," Marlins left fielder Christian Yelich said.
With the score tied in the bottom of the ninth in the nightcap, Jayson Werth led off with a double to left against Sam Dyson (0-2).
Perez replaced Werth, and with one out, he stole third on the front end of a double steal with Desmond, who was intentionally walked. Coghlan muffed a grounder off the bat of Wilson Ramos, bringing home Perez. There was no RBI on the play.
Washington closer Rafael Soriano (3-3) pitched a scoreless ninth for the win.
"The first game was tough to swallow," said Desmond, who has 21 steals and 20 homers this year. "A lot of good things happened in that (second) game."
In the first game of the split doubleheader, Giancarlo Stanton and Yelich hit home runs and closer Steve Cishek pitched a perfect ninth for his 27th save in a row to tie a club record set by Todd Jones in 2005.
In the nightcap, the Marlins tied the game at 4 in the eighth inning when Stanton hit a double to score Yelich.
Denard Span lined a two-run hit past diving first baseman Ed Lucas to give the Nationals a 4-3 lead in the sixth.
Strasburg went six innings and allowed three runs and six hits with six strikeouts. The Marlins had several loud outs against Strasburg, who had not pitched in two weeks.
"He was actually awful," Johnson said. "Every pitch he threw was up."
Said Strasburg: "I went out there and competed. I gave it everything I had."
Marlins starter Brian Flynn gave up two runs in four innings.
"It's one of those things where you wish you were never in it or if you're getting out of it, you wish it was in the seventh or eighth inning," he said.
The Nationals start a three-game series Monday in St. Louis. Washington ends regular-season play next weekend with three games against the Diamondbacks in Arizona.
Earlier Sunday, the Atlanta Braves clinched the National League East title a year after Washington won the crown.
The last-place Marlins (56-99) lost nine of 10 games at Nationals Park this season.
NOTES: Stanton has 13 homers and 24 RBIs in 30 career games at Nationals Park. ... Washington RHP Tanner Roark (7-0, 1.08 ERA) is slated to start Monday in St. Louis against RHP Adam Wainwright (17-9, 2.98). Roark leads the league with seven wins in a row, and he won his last six decisions at Triple-A Syracuse before he was promoted to Washington. ... The Marlins will begin a series Monday with Philadelphia, with Miami RHP Nathan Eovaldi (3-6, 3.79) facing Phillies RHP Roy Halladay (4-4, 6.71). ... Washington 3B Ryan Zimmerman has 11 homers this month. ... Strasburg recorded his 500th career strikeout when he got Yelich looking in the fifth.