As pressure mounted from tenants who were again without gas, the defendants came up with a new plan, prosecutors said. This time they would tap gas from a meter at 119 Second Avenue, a neighboring building also owned by Ms. Hrynenko to provide gas to the tenants next door.

Eric Pacheco, another unlicensed plumber, who pleaded guilty to one count of second-degree manslaughter, testified that he was present for a meeting in which Ms. Hrynenko peppered Mr. Kukic with questions about how soon the illegal gas line would be installed. (Mr. Kukic was previously convicted of bribing an undercover investigator posing as a housing inspector and is now also facing money laundering charges in federal court, prosecutors said.)

The defendants hid the illegal system, which was constructed by Mr. Ioannidis, 63, and located in the building’s basement, behind locked doors.

Over the next several months, Ms. Hrynenko tried to install a legal gas line, but Con Ed would not approve it because of a number of construction and design issues.

On March 26, 2015, Con Edison returned for a final inspection.

Before the inspection, Mr. Kukic and Mr. Ioannidis turned off the secret gas line. Mr. Kukic also warned a tenant that if anyone asked, “you don’t have gas.”

Inspectors again found fault with a proposed meter location in the basement.

Mr. Kukic and Ms. Hrynenko’s son, Michael Hrynenko Jr., turned the gas back on, but did not close several valves in the basement of 121 Second Avenue that had been opened for pressure tests by Con Edison.

Ms. Hrynenko was later alerted to the smell of gas by a restaurant employee. Her son and Mr. Kukic investigated the matter. Surveillance video captured the two men running out of the building without notifying patrons in the restaurant or calling 911. They ran into a basement entrance on East 7th Street where the rigged gas system was set up.