I worked and lived in 2 states. I'm having trouble with the state taxes. Can you help?

I lived and worked in NY for the first 4 months of 2021.  I then relocated to MA, where I worked for the remainder of 2021.  I've already entered the NY state tax information.  I'm currently working on the MA state form.  I'm on a page that's asking me "Pay Tax to Another State?   You may qualify for a Massachusetts credit if you paid income tax on income that was earned in, and taxed by, both Massachusetts and another state (in this case, NY)."  Do I enter "yes" or "no" here?  If yes, it then asks "Income taxed by another state."  Enter the total 5% income.....etc."  Am I supposed to fill this in with data from the job that I worked while living and working in NY?  Or, am I being asked something else? I'm confused........I've already entered the Ny job tax information.  Any help is greatly appreciated.