Mayor Bill de Blasio allotted $5.7 million of his $88.67 billion preliminary budget to a pilot program that would legalize basement apartments in East New York.

As part of the East New York Neighborhood Plan championed by Councilman Rafael Espinal and passed by City Council in April 2016, the project will turn basement apartments into legal, habitable homes. It is designed to increase affordable housing in the neighborhood and supplement homeowners’ incomes, Espinal said.

“For too long tenants and homeowners were being put at risk of eviction and major fines, while the city was missing out on an opportunity to maintain thousands of affordable units,” he said in a statement, referencing illegal basement apartments.

The process of legalization will include getting the basement apartments up to code -- such as ensuring the presence of a window, proper fire safety requirements and other security provisions, according to a spokeswoman from Espinal’s office.

The city agencies involved, such as the Department of Housing Preservation and Development, will guide homeowners through the conversion process, including helping with choosing contractors in case physical renovations are needed, the spokeswoman said.

The new apartments will all be affordable homes regulated by the HPD, according to Melissa Grace, a spokeswoman from the mayor’s office.

In accordance with de Blasio’s commitments to East New York’s rezoning plan, the basement legalization project could create up to 5,000 affordable homes citywide, as part of a larger three-year project costing $12.5 million.

“Basement apartments in so many parts of the city have not been legal, not been as safe as they should be, and have not been part of our affordable housing inventory,” de Blasio said at City Hall Thursday, promising to work with home and building owners in the neighborhood.

The biggest concern for housing advocates is that the city will make low-income homeowners borrow money to undertake repairs for the basement conversion process, according to Michelle Neugebauer, executive director of Cypress Hills Local Development Corporation.

“These homeowners, many of them senior citizens living on fixed incomes or homeowners who have battled back from foreclosure situations, cannot afford to incur any debt,” she said.

The neighborhood organization, which is a community-led advocacy group, is one of several agencies that formed the Coalition for Community Advancement: Progress for East New York and Cypress Hills and advocated for the East New York rezoning plan with Espinal, Neugebauer said.

“We believe the basement legalization strategy works to bring in new income to cash-strapped, struggling homeowners and to create new, safer affordable housing units for renters,” she said, adding that it is imperative the city fully subsidize the repairs for homeowners in the community.

Untangling the complicated processes of converting basements into housing for homeowners can be “daunting,” Jessica Katz, executive director of Citizens Housing Planning Council (CHPC), said.

“It is our hope that this pilot better understands the barriers for homeowners who want to convert their basement into legal apartments,” she said. “It should focus on simplifying that process for individual homeowners.”

On Feb. 17, CHPC released “Hidden Housing: Basement Apartments,” a study that found 10,000 to 38,000 potential basement apartments citywide.

The study found that before embarking on any conversion process, the health and safety concerns of illegal occupancy in such apartments must be taken into consideration. These dwellings also can be more dangerous in case of a fire, CHPC found.

However, the study deemed such a project an “efficient and exciting” way to add to the city’s housing stock without having to acquire new land and altering the shape or size of a building.

“People are living in these basements whether we like it or not, so it is important to make them habitable and legal,” Katz said.