This isn't something you'll find on your Form W-2 from a New Hampshire source.
Your non-Massachusetts source income is the total income you received from non-Massachusetts sources during the tax year. It's additional income that would have been reported on your Massachusetts return if you had been a Massachusetts resident that you received from non-Massachusetts sources. See Line 14e in the Instructions for Form 1-NR/PY, available at 2023 Massachusetts Personal Income Tax Forms and Instructions.
So, if you weren't a Massachusetts resident when you earned this income, the entire amount would be considered as non-Massachusetts source income.