Carlos Gómez lost his shoe during an early dash, then hit a go-ahead, three-run homer in the eighth inning that helped the New York Mets overcome a Nationals comeback that started after Washington manager Dave Martinez's heated ejection for a 6-4 victory Thursday and a four-game sweep.

Gómez bolted around the bases, smacking himself in the helmet and letting out a few joyous shouts after his two-out shot against Wander Suero (1-4). It was the veteran's first homer of the season and marked the third straight New York beat Washington in its final turn at-bat.

The Nationals seemed as if they'd snapped from their funk after Martinez's ejection in the eighth. Plate umpire Bruce Dreckman rang up Washington's Howie Kendrick for a strikeout as he tried to check his swing leading off, then tossed the veteran infielder. Martinez charged from the dugout, spiked his hat and kicked dirt on home plate while barking relentlessly at Dreckman.

New York Mets' Carlos Gomez, right, is greeted by Steven Matz after scoring on a sacrifice fly by Juan Lagares during the fifth inning of a baseball game against the Washington Nationals, Thursday, May 23, 2019, in New York. (AP PhotoJulio Cortez)

New York Mets' Carlos Gomez, right, is greeted by Steven Matz after scoring on a sacrifice fly by Juan Lagares during the fifth inning of a baseball game against the Washington Nationals, Thursday, May 23, 2019, in New York. (AP PhotoJulio Cortez)

Juan Soto then walked against Robert Gsellman (1-0), Victor Robles singled, and Yan Gomes brought in Soto with a double. Gerardo Parra followed with a pinch-hit, two-run single for a 4-3 Washington lead.

Washington dropped to 19-31, a record better than only the Miami Marlins, Baltimore Orioles and Kansas City Royals. The Nationals have lost five straight and six of seven.

The Mets swept the Nationals/Expos franchise over four games for the first time since July 1-4, 1991. It was the first four-game home sweep by New York in the series since May 15-18, 1972.

New York Mets center fielder Juan Lagares misplays a ball hit by Washington Nationals' Trea Turner during the fifth inning of a baseball game, Thursday, May 23, 2019, in New York. (AP PhotoJulio Cortez)

New York Mets center fielder Juan Lagares misplays a ball hit by Washington Nationals' Trea Turner during the fifth inning of a baseball game, Thursday, May 23, 2019, in New York. (AP PhotoJulio Cortez)

New York is 18-13 against the NL East and 24-25 overall. The Mets enter a three-game series against Detroit hoping to climb over .500 for the first time since May 2.

Edwin Díaz retired the side in order in the ninth for his 12th save.

Mets starter Steven Matz allowed 10 hits over six innings of one-run ball. He stranded runners in scoring position in each of his first five innings.

Washington Nationals' Gerardo Parra (88) reacts after hitting a two-run single off New York Mets relief pitcher Robert Gsellmann during the eighth inning of a baseball game, Thursday, May 23, 2019, in New York. (AP PhotoJulio Cortez)

Washington Nationals' Gerardo Parra (88) reacts after hitting a two-run single off New York Mets relief pitcher Robert Gsellmann during the eighth inning of a baseball game, Thursday, May 23, 2019, in New York. (AP PhotoJulio Cortez)

Washington starter Stephen Strasburg allowed two runs and five hits over seven innings.

Starting with an unusual 12:10 p.m. first pitch, both teams looked short on caffeine. New York had two errors, Washington had one and both teams had players thrown out on the bases. The Nationals struck out looking five times in the first six innings, all with runners on base.

Washington was 0 for 9 with runners in scoring position during the first five innings and also committed a few baserunning blunders. Adam Eaton missed first on a potential double and had to retreat, then was stranded at third. Brian Dozier scored Soto with a bunt single in the sixth but was thrown out making an ill-advised dash for third after a Mets throwing error on the same play.

Washington Nationals manager Dave Martinez, right, reacts after being ejected by home plate umpire Bruce Dreckman for arguing after Nationals' Howie Kendrick was called out on strikes during the eighth inning of a baseball game against the New York Mets, Thursday, May 23, 2019, in New York. (AP PhotoJulio Cortez)

Washington Nationals manager Dave Martinez, right, reacts after being ejected by home plate umpire Bruce Dreckman for arguing after Nationals' Howie Kendrick was called out on strikes during the eighth inning of a baseball game against the New York Mets, Thursday, May 23, 2019, in New York. (AP PhotoJulio Cortez)

SHOE FLY DON'T BOTHER

Gómez stole second in the fifth inning and took third on catcher Gomes' throwing error, and his left shoe flew off in the process. Gómez never broke stride and scored two batters later on Juan Lagares' sacrifice fly for a 1-0 lead.

IT'LL BE ALL RIGHT

New York placed infielders Robinson Canó and Jeff McNeil on the injured list prior to the game, leaving the team without two regular position players. The Mets went with an all right-handed lineup against a right-handed starting pitcher for the second time in franchise history, according to the Elias Sports Bureau.

TRAINER'S ROOM

Nationals: 1B Ryan Zimmerman (plantar fasciitis in right foot) has experienced some pain running in recent days and will back off. He was still expected to hit in a batting cage Thursday.

Mets: Canó strained his left quad running out a grounder Wednesday, and McNeil has a tight left hamstring, which he believes occurred stealing a base in the ninth inning Tuesday. Luis Guillorme and Ryan O'Rourke were recalled from Triple-A Syracuse. ... New York claimed former Phillies OF Aaron Altherr off waivers from San Francisco and designated RHP Tim Peterson for assignment.

UP NEXT

Nationals: Open a four-game home series against Miami with RHP Kyle McGowin (0-0, 6.00) set to make his second career start. RHP Pablo López (3-5, 5.06) is up for the Marlins.

Mets: RHP Noah Syndergaard (3-4, 4.50) starts the opener of a three-game home series against Detroit, opposing LHP Gregory Soto (0-2, 10.80).

Follow Jake Seiner: https://twitter.com/Jake_Seiner

More AP MLB: https://apnews.com/MLB and https://twitter.com/AP_Sports