Retirement tax questions

I am on the question in Turbotax for Massachusetts state filing, Income Taxed by Rhode Island. I live in Massachusetts and worked in RI during 2024. There are 2 questions on the form:

Income Taxed by Rhode Island

Enter the total amount of 5% income on which you paid taxes to RI 

Also enter the actual tax owed from the other state tax return for the income reported in both states. (this is not your w-2 withholding)

   Total 5% Income ________________

   Rhode Island Tax Paid on this Income_________________________

1. Is Total 5% Income total income from RI or combination of RI and MA(wages,salaries). OR is this the total income to be taxed on after deductions and exemptions on RI form.  Example: Line one of the state form, salary wages from fed form is $70000. After exemptions and standard deductions the RI taxable income on line 7(RI form) is $30000. Is one of these amounts what I put for 'total 5% income'?

2. RI Tax Paid on the income - Is this the actual amount I paid to RI or what I actually owe them. Example I paid $150 in state taxes but after filling out the RI 1040NR form I do not owe RI anything and will be getting a refund. So what goes in this box $150 or $0?

Thanks,

Donna