New York is trailing Rhode Island in the growing battle to replace the union-favored Last In, First Out policy when it comes to laying off teachers and relying instead on merit to decide who goes and who stays.

Rhode Island’s Education Commissioner Deborah Gist dispatched a memo to school district chiefs throughout her state warning that budget-related layoffs based solely on teacher seniority violates state law. She said the new edict best serves students.

Her memo comes in the wake of a state Providence school-board vote to send layoff notices to all of the district’s 1,926 teachers.

Under the Ocean State’s laws, there is a requirement that layoffs of teachers due to a drop in student enrollment must be done according to seniority.

But Gist insists the law “does not provide the same for reductions in the teaching force because of budgetary constraints or program reorganizations.”

And she said Rhode Island’s new Basic Education Program curtails LIFO and injects merit and other criteria into decisions regarding budget-related layoffs.

“The BEP requires districts and schools to recruit, hire and retain highly effective personnel based on district and student need . . . Teaching positions based solely on seniority cannot comply with this requirement,” Gist said.

She said the anti-LIFO requirements “supersede” any conflicting provisions in labor agreements between school districts and teachers unions.

Meanwhile, the Providence Board of Education voted Thursday night to give termination notices to all of its 1,926 teachers as a precaution to address budget cuts.

The decision to give teachers letters of dismissal rather than layoff notices ends the guarantee for veteran teachers to invoke seniority rights to reclaim their jobs in the future, union officials charged.

Back in New York, Mayor Bloomberg said on his WOR radio show yesterday that a Quinnipiac poll showing 85 percent of state residents supporting merit-based layoffs bolsters his campaign to persuade the state Legislature to end LIFO.

“There’s a lot of legislators who would be — normally, you would expect because of pressure from certain special interest groups — very reticent to sign on to this,” he said, referring to opposition from the teachers union.

“They’re going to start to look at these polls and say, ‘Wait a second.’ ”

Bloomberg also said he’s urging Gov. Cuomo to insert a LIFO repeal as an amendment to the governor’s spending plan.

“I’ve urged the governor to put it into his budget, because the budget you know is going to get passed,” he said.