Peralta, one of six St. Louis All-Stars, barely cleared the left-field fence on a two-out drive for his 14th homer. Kirk Nieuwenhuis made a leaping effort and his glove ticked the ball that landed in the Mets' bullpen.
Curtis Granderson hit his fifth leadoff homer of the season for the Mets, who won four in a row before the All-Star break.
Lynn (7-5) allowed a run and three hits in seven innings. Syndergaard (4-5) also worked seven innings, allowing two runs and five hits.
Link to box score: St. Louis (57-33) 3, New York Mets (47-43) 2