A small, single-engine plane crashed in a field on a family farm on Long Island’s North Fork on Saturday morning, killing both people on board — but the couple’s dog somehow made it out alive, according to officials and witnesses.

Pilot Robert Mark, 66, and his longtime girlfriend, Susan Quagliano, 57, had just left Long Island MacArthur Airport and were in the air for only 15 minutes, when the engine failed at 9:15 a.m., according to law enforcement sources and people who knew the couple.

Mark, an experienced formation flyer and instructor, had been heading to Bedford, Mass., to lead a missing man formation flight there, his good friend and fellow pilot Sacha Botbol told The Post.

Instead, he died a hero, steering the plummeting Beechcraft A36 Bonanza away from homes when he knew the plane was in trouble.

Moments later, the craft crashed in flames on Harbes Family Farm on Sound Avenue in Southold, Suffolk County, officials and witnesses said.

“I think the pilot — getting the plane away from homes — really needs to be commended on that,” said Ken Cooper, who witnessed the crash as he drove past.

“I believe he’s a hero.”

When Cooper rushed to the scene, he found the wreckage in flames below a plume of black smoke. Scattered in the field were a baseball hat, the plane’s propeller, flight paperwork and other personal effects, he said.

The surviving dog, which was still on its leash, had been quickly rescued from the scene by Eddie Harbes, the farm’s owner, and was returned to arriving family members of the victims, officials and witnesses said.

Neighbors and friends said the couple, of Oakdale, were inseparable from their dog, Coco, a constant traveling companion on flying and boating trips. It was unclear if Coco was the miracle pooch who walked away from Saturday’s wreckage.

“She was straight-up loving retirement, every day” neighbor Joyce Sims said sadly of Quagliano. “She was taking classes, walking the dog. They just renovated the house.”

She called Mark, “the kindest, most generous and warm, witty man.”

She added, “We flew with him a lot . . . he was the safest,” before losing her composure.

“Oh, my God, my heart breaks,” she said.

“The plane flipped, and they both perished, but the dog managed to escape somehow,” Botbol said.

Photos on Mark’s social media show him with the dual control plane as far back as eight years ago. Recently, though, the plane, which records show was manufactured in 1990, had needed repairs.

“He had been having trouble with his engine, and had just put new cylinders in very recently, about 20 flying hours ago,” Botbol said of Mark.

“He was a fantastic pilot, extremely accomplished, and flew all over — the Caribbean, across the country,” he said of Mark, a software specialist and the father of an adult son and daughter.

“If that plane hadn’t flipped and caught fire, it would have been very survivable,” Botbol added, sadly.

“He probably landed with the landing gear up, to reduce his landing distance” in the small field, Botbol speculated. “Landing on the belly, on soft ground, you’re less likely to flip. The landing gear wouldn’t snag on the uneven ground, and you come to a stop within 300 feet.”

Cooper, of Wading River, had watched the plane fall as he drove east on Sound Avenue, and was the second person, after Harbes, to reach the crash site.

“The plane came from my right, which is south, heading north at a steep decline,” he told The Post.

“He was about a quarter mile from me. I saw him bank left, behind a tree line, and within forty seconds I saw a plume of black smoke,” he said.

Cooper turned off Sound Avenue and turned onto a dirt road to get closer.

“I found the first road I could take a left on to get to the crash site,” he said.

“I pulled up and thought, there was no way they survived. It was just devastating. I couldn’t believe the wreckage and damage.”

“It was burning pretty strongly,” he said of the plane. “There was no sign of life.”

He could only make out the tail of the plane through the flames, he said.

“You can tell the tail of the plane. That was it,” he said. “This thing was burning. It just disintegrated.

“Personal contents. Just horrible for people. He added, “My God, their family. Just horrible.”

The plane was registered to RI Aviation Services LLC, based out of Burlington, Mass.

Investigators believe the aircraft’s engine had failed, the sources said.

The NTSB and the FAA were investigating the incident.

Additional reporting by Annie Wermiel, Stephanie Pagones and Laura Italiano