Non-Massachusetts Portion of Deductions...?

I worked 2 different jobs in 2 different states in 2021.  I'm completing the state taxes, and it's asking me to "enter the non Massachusetts portion of the amount you paid during 2021 to Social Security (FICA), railroad, Medicare, U.S., or Massachusetts retirement."  Do I get this information from the W-2 for the job that I worked in the other state?  If so, what boxes on the W-2 do I use?  Thanks in advance.....