The bonus was earned/sourced from MA.
If you're a nonresident with an annual Massachusetts gross income of more than either $8,000 or the prorated personal exemption, whichever is less, you must file a Massachusetts tax return.
You are an individual nonresident if you are neither a full-year or part-year resident.
You may be able to file a MA Non-resident return to get your MA taxes returned. Fill out the MA return first.
Massachusetts Department of Revenue
If you are a New York State resident you must file Form IT-201, Resident Income Tax Return, if you meet any of the following conditions:
New York Department of Taxation and Finance