Massachusetts' law is that pension income from other state or local governments that do not tax
pension income from Massachusetts public employees is exempt from
Massachusetts taxable income.
Since NJ does not tax out-of-state government pensions, your NJ pension is not taxable in MA if it is from a state or local government. https://www.mass.gov/service-details/view-other-states-tax-treatment-of-out-of-state-government-pensions