The Mets honored Mariano Rivera for his pending retirement Tuesday night by having the legendary closer throw out the ceremonial first pitch. The final regular-season offering of his storied career at Citi Field later resulted in the Mets’ second consecutive rousing comeback win over the Yankees.

The incomparable Rivera coughed up three straight hits in the ninth — including tying and go-ahead singles by David Wright and Lucas Duda, respectively — to spare Mets ace Matt Harvey his first loss of the season and lift the Mets to a stunning 2-1 walk-off victory.

After the Mets improbably stole a pair of well-pitched games in Flushing, the four-game set will switch to the Bronx for two games beginning Wednesday night at the Stadium.

“Everything was great, until the ninth. . . . It was a great game until I got into the game,” said Rivera, who had never in his career failed to record an out in a save situation. “There are no excuses. They just beat me. Too bad that (Hiroki) Kuroda pitched a tremendous game. For me to do that is unacceptable.”

Before the game, Rivera continued his retirement tour by receiving a hose nozzle from a fire truck and a call box, accepting the fireman-related gifts from Mets COO Jeff Wilpon and New York City Fire Commissioner Sal Cassano.

Baseball’s all-time saves leader (626) also accepted Wilpon’s request to throw out the first pitch, waiting out a 91-minute rain delay at the start of the game to toss a strike to former Mets closer John Franco.

The pitching performances only got better from there, as Harvey certainly lived up to his buzz-worthy billing in the Yankees’ first in-person look at him. The 24-year-old righty and childhood Yankees fan from Connecticut allowed just one earned run on six hits over eight innings and finished with 10 strikeouts and no walks to lower his ERA to 1.85.