Hamburg Central School teachers and administrators should thank New York City. Or, at least give it a nod.

Educators in Hamburg have tentatively agreed on a teacher evaluation plan, 2½ months after negotiations seemed lost, along with state aid.

But both sides reached an agreement last week and the union’s contract committee overwhelmingly approved the plan. Next up, a vote by the rank and file. If the Hamburg Teachers Association ratifies the plan, the School Board will meet to approve it, and it can then be whisked off to New York State for approval.

It has been a long, bumpy road for the small school district these past few months. Hamburg and three other districts, including New York City, failed to meet the Jan. 17 deadline for state approval. Gov. Andrew M. Cuomo wasn’t keen on excuses and the state said those districts would lose the increase in state aid promised them for this school year. The amount is worth $450,000 to Hamburg, no small change for a small district.

But as in cycling, in which a racer rides very closely behind another, Hamburg was able to draft New York City. Parents in the Big Apple obtained an injunction against the state for their lost aid. And the state has not withheld money from Hamburg, pending the outcome of the New York City lawsuit, according to the Hamburg superintendent.

Sometimes luck breaks just right, and not a moment too soon.

Hamburg teachers and district administrators were a bit at odds. Some teachers, already wary about the school leadership, perceived a comment by an administrator as a threat to their jobs if the plan was not approved. The district denied the comment was made as a threat but the damage was done, and it was too late to submit the plan to the state for review and approval.

Now, using the time New York City has likely bought them, teachers will be given copies of a new plan at a meeting April 11. A ratification vote is expected to be conducted April 18 and the School Board will likely schedule a special meeting April 19 to approve the plan.

And if teachers and administrators fail to communicate in the future? The governor and legislative leaders have agreed that if any of the four districts that still need to get a plan approved don’t do so, the state will impose a one-time binding arbitration process, with State Education Commissioner John King acting as the arbitrator and imposing an evaluation system.

That’s one way to take care of a problem that directly affects students. Another would be just to do the job.