Landlords in Brooklyn who didn’t want to pay or wait for official plumbers and the utility National Grid to connect gas service hired a makeshift crew to do the job and jeopardized safety, the borough’s prosecutor said in announcing 37 arrests.

In exchange for cash payments ranging from $1,300 to $2,500, the crew would illegally install inferior piping and a gas meter, a shortcut for a process that could last months, the district attorney’s office said.

“They had a guy that could get this done for a cash payment,” the acting district attorney, Eric Gonzalez, said at a news conference Thursday.

Charges against some of the defendants include enterprise corruption, which affected 33 new or renovated borough properties in Williamsburg, Bedford-Stuyvesant, Brooklyn Heights, Bushwick, Crown Heights, Midwood and Borough Park. The alleged crimes occurred in the first half of 2016.

In a boom real estate market, delays in activating gas service can mean lost revenue for landlords.

advertisement | advertise on newsday

The properties have since been retested and certified safe, said the city’s investigation commissioner, Mark Peters.

The “mastermind,” Weldon Findlay, 47, of Brooklyn, had worked for National Grid until 2010, Gonzalez said. Under the scheme, Findlay would set into motion a process involving a customer-service agent who still worked for the utility, who would improperly bypass procedures and create accounts for addresses who shouldn’t get service. Then co-conspirators would ignore procedures, get assigned the jobs, and install the meters.

One of the defendants, Jonathan Ahdoot, 34, is from Great Neck. A message left at his home wasn’t returned Thursday night. According to a news release from Gonzalez’ office, Ahdoot is listed as a landlord, property manager or contractor, not a “mastermind.”

advertisement | advertise on newsday

Arraignment information for the 37 defendants was not immediately available.

National Grid spokeswoman Karen Young declined to answer questions about the case, but said in an emailed statement that the company “has conducted safety inspections, and has taken corrective measures where needed” and would work to “implement any additional controls and recommendations required to prevent a similar situation from recurring in the future.”