NEW YORK -- Todd Frazier and Jeff McNeil each homered twice, helping the surging New York Mets stun Diamondbacks ace Robbie Ray and beat Arizona 9-0 Wednesday night.

The Mets scored their nine runs on 11 hits on a night when Major League Baseball honored those whose lives were lost or affected on Sept. 11, 2001. The Mets wore hats honoring first responders during batting practice and had first responders on the field for the national anthem.

"What a great day. Just to have all the first responders on the field, getting to stand in between [them]," Mets manager Mickey Callaway said. "I know I had some pretty cool conversations with the guys around me; I'm sure everybody out there on the line did. He was just talking about that day, and all the cleanup after -- it's amazing. So that was neat in its own right; and then to come up and win a game for them, and to get nine runs on 11 hits, that's even cooler."

Slugger Pete Alonso coordinated the purchase and production of custom 9/11 cleats for Mets players to wear 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.

Alonso said he wanted to design hats the Mets could wear on the field, but that idea was rejected by Major League Baseball, which hasn't allowed the Mets to wear first responder hats during games since 2001.

"I think it's kind of sad that first game back, they've kind of shot it down every single year since," Alonso said. "It's real unfortunate. So a way to kind of get around that was the cleats."

Alonso said he went around the Mets' locker room and collected shoe sizes and preferred brands for each teammate. He said he didn't contact Major League Baseball about the cleats.

"I feel like if Major League Baseball kind of got their hands on it, it may not have been approved," Alonso said. "But I'm really happy that we kind of banded together here in the clubhouse and made something cool happen."

The cleats were just the latest in Alonso's efforts to assist those impacted by the attacks. 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.

Before the first pitch Wednesday night, children who lost parents or grandparents to 9/11-related illnesses ran to each position before being joined by the Mets' starters. Alonso gave autographed baseballs to the two children at first base.

Both the Mets and Diamondbacks wore first responder hats during batting practice, then lined up on their respective baselines alongside firefighters, police and emergency medical technicians prior to the national anthem.

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 National League wild card.

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 out in the first. Wilson Ramos (groundout) and J.D. Davis (single) had RBIs 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. 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 out Carson Kelly and inducing a double-play grounder from Kevin Cron.

Ray gave up five hits and struck out one.

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⅓ innings for the Detroit Tigers against the Twins on Aug. 22, 2014, and 1⅓ innings for the Diamondbacks against the Washington Nationals on April 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.

Information from The Associated Press was used in this report.