An ex-welfare recipient who was required to work for his benefits will get a shot at hanging onto his $10,000 lottery prize if he can show that his earnings at the federal minimum wage were greater than the value of his assistance, a state appeals court has decided.

In recouping benefits, localities must give former recipients credit for the amount they would have earned while participating in “workfare” programs as if they had been paid the federally mandated minimum wage, the Appellate Division, Second Department, ruled yesterday.