The Mets ended the game with nine runs on 11 hits on a day when all 30 MLB teams remembered the events of Sept. 11, 2001 as baseball honored those whose lives were lost or affected that day.

The Mets (75-70) have won the first three games of the pivotal four-game series to move past the Diamondbacks (75-71) in the race for the second NL wild card. New York entered Wednesday three games behind the Chicago Cubs, who played later Wednesday at San Diego.

Arizona has lost four straight since going 11-1 to rush back into the crowded NL playoff picture.

Steven Matz (10-8) tossed six scoreless innings for the Mets, who jumped on Ray (12-8) for five runs before chasing him with two outs in the first. Wilson Ramos (groundout) and J.D. Davis (single) had RBI before Frazier and Brandon Nimmo homered on consecutive pitches.

McNeil hit a solo homer in the second, and Frazier hit his 20th homer of the season, a solo shot, in the third. McNeil then joined Frazier in the 20-homer club with a two-run drive in the sixth.

The Mets have four players with 20 homers for the fourth time in franchise history. Pete Alonso leads the majors with 47, and Michael Conforto has 29.

Matz allowed four hits and three walks while striking out seven. He issued all three walks to open the second before striking Carson Kelly and inducing a double play grounder from Kevin Cron.

Ray gave up five hits and struck out one.

REMEMBERING 9/11

Alonso coordinated the purchase and production of custom 9/11 cleats for Mets players on the 18th anniversary of the terrorist attacks. The shoes were painted red, white and blue and included “We will never forget” and lettering for first responder units. After winning the All-Star Home Run Derby in July, Alonso donated $50,000 of his $1 million prize to the Tunnels to Towers Foundation.

The clubs also wore first responder hats during batting practice, then lined up on their respective baselines alongside firefighters, police and EMTs prior to the national anthem.

Prior to first pitch, children who lost parents or grandparents to 9/11-related illnesses ran to each position before being joined by the Mets’ starters. Alonso gave baseballs to the two children at first base while Amed Rosario went to one knee at shortstop to talk to the children there.

IT’S A SHAME ABOUT RAY

Ray endured the shortest start by a Diamondbacks pitcher since T.J. McFarland gave up seven runs while recording just one out against the Minnesota Twins on Aug, 20, 2017. It was the shortest start ever for Ray, who lasted 1 1/3 innings for the Detroit Tigers against the Twins on Aug. 22, 2014 and 1 1/3 innings for the Diamondbacks against the Washington Nationals on Apr. 29, 2018.

TRAINER’S ROOM

Diamondbacks: RHP Luke Weaver (right flexor strain) is scheduled to throw 35 pitches or two innings for Class A Visalia in a playoff game Friday. Weaver hasn’t pitched for Arizona since May 26.

Mets: RHP Robert Gsellman (lat) played long toss Wednesday and holds out hope he can return this season.

UP NEXT

Diamondbacks: LHP Alex Young (7-3, 3.38 ERA) is coming off the best start of his rookie season when he gave up two hits and struck out 12 over eight innings in a 2-0 win over the Cincinnati Reds.

Mets: RHP Marcus Stroman (7-13, 3.42 ERA) has recorded just one quality start in seven tries for the Mets, who acquired him from Toronto on July 28.