State tax filing

the NJ income was earned when I was a part time MA resident. I moved to AL in July. Shouldn’t NJ determine my tax based on income when I lived in MA?