Two NYPD cops – one of whom was the groom on his wedding day – were killed when their rented Maserati crashed upstate, authorities said Monday.

Michael Colangelo, 31, a 10-year officer with the NYPD’s ESU K-9 unit who had just gotten married, and Officer John M. Martinez, 39, who was assigned to Brooklyn’s 84th Precinct and had 16 years on the force, were killed in the Sunday night crash in Ulster County, state police said.

Both men, who lived on Long Island, were pronounced dead at the scene of the crash on Oliverea Road in the town of Shandaken.

A third person in the car, 28-year-old Cody Kalina of Wantagh, LI, suffered non-life threatening injuries and was rushed to Albany Medical Center.

State police said Martinez, a married father of two from Hauppauge, was driving the 2018 Maserati on Oliverea Road when the high-end sports car “left the roadway and struck a large tree” before flipping over and coming to a rest on its roof about 11:23 p.m.

Colangelo, a resident of Huntington Station in Suffolk County, and his wife, Katherine, a registered nurse, had just had their wedding reception at the Full Moon Resort in the Catskills.

The victims were less than a mile away from the reception at the time of the crash, an investigator with the state police said.

Colangelo and his wife were planning to honeymoon in Costa Rica, according to an account on HoneyFund.com.

“We’ve lived together quite a while with all our pots and pans, and as we don’t need very many home goods we’ve got another plan! We know it’s not traditional but it would be a lot of fun, to have some items on our wedding list that will help us catch some sun!” reads the profile set up by the couple.

“So if you’d like to give a gift to send us on our way, a donation to our honeymoon would really make our day! Then while we’re relaxing on the beach, or by the pool so blue, we’ll sit back and know that it is truly thanks to you!!”

Police sources said Colangelo and Martinez met while working for the NYPD’s elite Emergency Services Unit – where Martinez recently worked before moving to the 84th Precinct.

Neighbors were shocked by the tragic crash.

“He’s a neighborhood guy. He loved his work. He was on 10- or 12-hour shifts,” Raymond Spatafora, 62, said of Colangelo, who lived next door to him.

Spatafora said Colangelo would always bring home his canine partner “Jimbo” every night.

“It’s terrible. Very, very sad. He just got married. His wife was very, very nice. She was quiet. She worked a lot of hours as a nurse,” the neighbor said, adding that Colangelo “would have barbecues and have a lot of his friends over in the backyard.”

Spatafora called Colangelo “an all-around good guy.”

“I was shocked [to learn the news]. All of a sudden when you’re talking to somebody one day and the next day you don’t see them — it’s terrible,” he said.

Martinez was the father of a 10-year-old girl and an 8-year-old boy, law-enforcement sources said.

Officers at the precinct were taking the loss “very hard,” the Rev. Michael Lopez, a department chaplain, told The Post after consoling the cops Monday.

“He was a great guy, a great upstanding guy, and they all love him,” Lopez said.