For years, there’s been talk of funding legal counsel for city residents facing eviction in a broad, inclusive way. But despite City Council support, concern about the scope and cost always prevented full budgetary support from City Hall.

Mayor Bill de Blasio has proposed a program that eventually will provide free legal representation to any city resident facing eviction who earns less than $50,000, and legal counseling to anyone whose income rises above that threshold. At full scale, the program will cost $155 million a year.

The funding, and the legislation to accompany it, emerged from an agreement between de Blasio, who is up for re-election in November, and City Council Speaker Melissa Mark-Viverito, who for years has been fighting for what’s known as the “right to counsel.”

City officials said they will expand existing efforts to partner with nonprofit organizations, including the Legal Aid Society and neighborhood organizations, to provide counsel to any tenant who needs it. Included in the plan is a publicity effort so those who are most vulnerable are aware that representation is available. The city also says it will make sure attorneys are present and available at housing court so representation is available on the spot. That’ll be important, because many tenants facing eviction don’t know their rights or the services the city provides.

NYC’s efforts mark another step toward seeking fairness in a universe where 90 percent of landlords walk into court with representation, while only 27 percent of tenants do.

City officials should make sure nonprofit organizations are properly staffed to handle the caseloads and that new staff members are properly trained, then track the program’s successes and failures. Key will be outreach to low-income tenants to help with problems before eviction is threatened. Eviction can be the start of a spiraling series of problems, from homelessness to school drop-outs. Access to legal counsel alone won’t stop it, but it’s an excellent place to start.