Police were questioning a man on Wednesday in connection with the slayings of two men, a day after they were shot in the head by a masked gunman inside a commercial loan business on Staten Island, authorities said.

The victims, 57 and 52 years old, were at the business on Buel Avenue in Dongan Hills, the address of Universal Merchant Funding, at 6:15 p.m., police said. The gunman entered the building and shot both men in a backroom, they said.

The victims were pronounced dead at the scene, police said. One of the men was identified as Michael Genovese, 57, of Edgewater, New Jersey. The identity of the other man has not been released, pending family notification.

Detectives believe the victims were shot to death by someone who at one time possibly worked at the company, a law enforcement official said.

At a briefing for reporters after NYPD Commissioner James O’Neill’s presentation to the New York Police Foundation, Chief of Detectives Robert Boyce said detectives quickly ruled out robbery as a motive in the slayings.

“We believe one or two of these males were purposely targeted by the shooter,” Boyce said. “Each male was shot three times at close range.”

Asked about possible organized crime connections to the shooting, Boyce said there weren’t any. The double homicide is the city’s first of 2017.

The man in custody, who was not immediately identified, had not been charged as of Wednesday night.

-With Anthony DeStefano