Cespedes had three RBI and finished a single shy of the cycle as the Mets beat the San Diego Padres 6-5 to win for the sixth time in seven games.
Cespedes' check-swing triple in the seventh inning was the difference. Facing reliever Phil Maton, Cespedes punched a pitch down the right-field line with Curtis Granderson aboard after an inning-opening single. Granderson scored and Cespedes followed him home on Wil Myers' throwing error for a 6-4 lead.
It was the Mets' third "Little League homer" -- one aided by errors -- since the All-Star break.
"I really wanted to hold the swing back, but I couldn't," Cespedes said through a translator.
Cespedes exited the game after running the bases with a sore quadriceps, which isn't considered serious.
Myers' errant throw was fielded by left fielder Jose Pirela, and he had a chance to get Cespedes at the plate.
"So we send Granderson and I pick up Ces and I thought they had a play on him, which they did," Mets manager Terry Collins said. "On the overthrow, the left fielder did a great job backing him up, but Ces just had a good slide."
Seth Lugo (5-2) went at least six innings for his third straight start, which has produced two wins. He surrendered four runs -- three earned -- and eight hits. He struck out one.
"Overall, I had a pretty good bad day," Lugo said.
Jose Torres (5-3), who worked 1 2/3 innings, took the loss.
Kyle Lloyd made his major league debut after being summoned from Triple-A El Paso. He pitched four-plus innings and was charged with four runs and six hits. He walked two and struck out two.
"Some of the hits that fell in were definitely on the softer side," Padres manager Andy Green said.
Added Lloyd: "I just tried to make the most of the opportunity."
Myers' fifth-inning sacrifice fly tied the score at 4. The Padres were aided by Asdrubal Cabrera's error in his fourth career start at third base.
The Mets chased Lloyd in the fifth after Granderson and Cabrera delivered consecutive doubles. Kirby Yates relieved Lloyd and gave up an RBI double to Cespedes in pushing the Mets ahead 4-3.
Travis d'Arnaud's RBI single pulled the Mets within 3-2 in the fourth.
The Padres seized the lead in the second, fueled by two home runs. Allen Cordoba smacked his first homer since May 13, a two-run shot to push the Padres ahead 3-1. Hunter Renfroe homered in his third consecutive at-bat earlier in the inning when he smacked Lugo's 77 mph curveball.
Cespedes put the Mets up in the first with a solo shot, his 10th homer of the year and his fourth in six career games at Petco Park.
"It has just been a matter of going for swings in the zone, swinging at better pitches," Cespedes said.
Mets: Collins said RHP Jeurys Familia (blood clot, right arm) is playing catch and will be moving to the mound soon. Collins said he expects Familia to pitch again this season for the Mets, he's just not sure when.
Padres: INF Yangervis Solarte (strained left oblique) is taking batting practice from both sides of the plate. ... C Austin Hedges (concussion) is doing baseball activities, but there is no timetable for his return.
Mets: LHP Steven Matz (2-3, 4.67 ERA) will try to win for the first time in his last five starts. Over his past three outings, he's given up 15 runs in 10 1/3 innings. He no-hit the Padres for 7 1/3 innings when beating them in August.
Padres: RHP Jhoulys Chacin (9-7, 4.26 ERA) has won but once in six lifetime decisions against the Mets. But he was solid his last time out when defeating the Giants, surrendering two runs and four hits over six innings.
More AP baseball: https://apnews.com/tag/MLBbaseball
This story has been corrected to fix final score to 6-5 in 2nd paragraph.
Fantasy baseball forecaster: Team hitting ratings
Stay ahead of the game and optimize your fantasy baseball hitters with our forecaster, which provides a rolling 10-day outlook of every team's hitting matchups as well as the potential for stolen bases.
Fantasy baseball forecaster: Pitcher projections for the next 10 days
Keep up to date on who is pitching -- and how well they're expected to do -- with our forecaster, which provides a rolling 10-day outlook of every team's probable starting pitchers with game score projections.
MLB players who have graduated to stardom -- and superstardom -- in 2021
Vlad Jr. became a household name this season. Who else took it to another level? David Schoenfield makes their cases -- and Judge Jeff Passan rules.
The San Francisco Giants just keep surprising us
No one saw the Giants coming this year. But that doesn't mean we shouldn't enjoy this run -- a celebration of surprise, and the joy that comes with celebrating wildness and wonder.
Sale scheduled to start for Boston against New York
New York Mets (73-78, third in the NL East) vs. Boston Red Sox (87-65, second in the AL East)
Lopez scheduled to start for Chicago against Detroit
Chicago White Sox (85-66, first in the AL Central) vs. Detroit Tigers (74-78, third in the AL Central)