An Elmont man who set fire to five parked cars in his neighborhood was caught in the act by a witness who knocked him out with a punch until cops arrived, Nassau police said Thursday.

Juan F. Perez, 37, of Keller Avenue, was charged with three counts of third-degree arson and third-degree criminal mischief for setting the series of car fires within blocks of one another in an hour-and-a-half time frame beginning about 3:25 a.m. Thursday, police said.

In total, five cars were set ablaze — a 2001 Mercedes-Benz SUV, a 2008 Infiniti SUV and a 2009 Toyota SUV on Stone Street, a 2014 Infiniti on Steele Street and a 2012 Nissan on Terrace Avenue, police said.

Another car was damaged due to “radiant heat” from one of the blazes, and Perez allegedly slashed the front seat and dashboard of a 2009 Chevy parked on Hillsborough Avenue, police said.

Nassau Det. Lt. Richard LeBrun said Perez’s motive for breaking into the cars appeared to be “financial gain,” but it was unclear why he set them on fire. LeBrun said police have not found any accelerant in Perez’s possession.

Perez is set to be arraigned Friday. It was not clear Thursday whether he had an attorney.

advertisement | advertise on newsday

He was arrested after getting into a “physical altercation” with a witness, described by police only as a 32-year-old man who “confronted” Perez on Lincoln Street, LeBrun said.

The men struggled briefly, and the witness subdued the man until Fifth Precinct officers arrived, police said.

Perez, who police said appeared to be heavily intoxicated, was taken to the hospital for injuries he suffered in the fight, LeBrun said.

Vladimir Cave, 32, in an interview, said he was the man who fought off the suspect.

Cave was up early to drive his father to the airport, and saw the man rifling through the trunk of his cousin’s red, 2014 Infiniti Q50, parked outside his home on Steele Street.

“I was walking outside and he’s in the trunk and I just followed him up the block and I asked him to give back what he took,” said Cave, as he stood near the burned car Thursday afternoon. “I said I was gonna call 911 and he attacked me. He threw a punch and I defended myself.”

Cave said he punched Perez, knocking him out, and he called 911. By the time he ran back to the car, the trunk was engulfed by flames, he said.

Nassau County police respond to Terrace Avenue in Elmont where a car was set on fire early Thursday, May 26, 2016. Photo Credit: Howard Schnapp

Cave said he took a running garden hose and threw it in the trunk and shut it, to stop the fire from spreading. He called a neighbor for help and went back and saw the suspect, still lying on the ground.

advertisement | advertise on newsday

Police arrived on the scene quickly, he said, and took the suspect into custody, he said.

One of the victims, Thomas Zacharia, said he woke up at 4 a.m. in his Stone Street home to find his 2001 Mercedes-Benz sport utility vehicle engulfed in flames.

He called 911 and police and firefighters arrived “within three minutes,” he said.

“I looked and saw flames coming,” said Zacharia, 57, an inspector with the New York City Housing Authority. “I couldn’t believe it.”

He parked the black SUV across the street from his house about 10 p.m. Wednesday after returning from Queens. The SUV’s insides are charred, and its windows blown out.

advertisement | advertise on newsday

Zacharia said the car belonged to his late wife and had 135,000 miles, relatively low mileage for a 15-year-old car.

“I have another car,” Zacharia said. But on the SUV he carried only liability insurance, so it will be a total loss.