How do you file for W-2 provided in another state?

My employer was in a lawsuit and I received a settlement payment. I received both a 1099 -MISC form as well as a W-2 form from the lawsuit’s “Settlement Fund”, which is handled by a company located in Massachusetts, a state in which I do not reside in. Do I still need to file a tax return with Massachusetts since the W-2 shows income tax being withheld in that State? Would this be filed as a non-resident?