The Mets' Tyrone Taylor celebrates with teammates Luis Robert Jr....

The Mets' Tyrone Taylor celebrates with teammates Luis Robert Jr. and Carson Benge after hitting a go-ahead three-run home run in the sixth inning of a game against the Los Angeles Dodgers at Citi Field on Sunday. Credit: Newsday/Thomas A. Ferrara

Tyrone Taylor hit a go-ahead three-run homer in the sixth inning, Marcus Semien added a three-run drive in the seventh and the Mets beat the Los Angeles Dodgers 8-3 on Sunday to prevent a season sweep.

With the Dodgers leading 3-1, reliever Jack Dreyer walked rookie Carson Benge and pinch-hitter Luis Robert Jr. in the sixth. Taylor gave the Mets a 4-3 lead by hitting a 1-1 sinker from Evan Phillips (0-2) into the left-field seats.

It was Taylor's eighth homer this season and fifth in 33 at-bats since returning from the injured list June 28. Eligible for free agency after this season, the backup outfielder appears likely to get traded before the Aug. 3. deadline.

Freddy Peralta allowed three runs — two earned — and six hits over four innings in what could end up being his final start for the Mets. Peralta also can become a free agent following the World Series and is expected to get moved sometime within the next eight days as part of a significant selloff by the last-place Mets (44-62).

A.J. Ewing scored on a passed ball by Dalton Rushing in the seventh, and Semien made it 8-3 with a drive to left off Will Klein for his second homer since returning from a strained left hip on July 16.

Francisco Lindor had an RBI single in the first, when the Mets started with three straight hits.

Cionel Pérez (4-3) pitched two perfect innings for the win. Luke Weaver escaped a bases-loaded jam in the eighth by making an off-balance throw on Teoscar Hernández’s bouncer to the third base side of the mound.

The Mets ended a five-game home losing streak and won for the fourth time in their last 16 games at Citi Field. The Mets finished 1-5 against the Dodgers to avoid getting swept in the season series for the second time in team history.

Freddie Freeman hit an RBI double for the Dodgers, who went 2 for 13 with runners in scoring position and finished 6-3 on their East Coast trip against the Yankees, Phillies and Mets.

Shohei Ohtani opened the game with a double and was 1 for 4. Ohtani, dealing with left knee irritation that is keeping him off the mound, is 7 for 38 (.184) since the All-Star break.

Los Angeles starter Emmet Sheehan allowed one run in five innings.

Rookie Zac Thornton (1-1, 1.93 ERA) opposes Martín Pérez (6-6, 3.38) in the opener of a three-game series at home against Atlanta on Monday.

SUBSCRIBE

Unlimited Digital AccessOnly 25¢for 6 months

ACT NOWSALE ENDS SOON | CANCEL ANYTIME