Nonresident income in Maine

I live in New Hampshire and work in Maine - Maine taxes were withheld on my W2. I’m filing as a nonresident of Maine. I’m asked to complete 2 areas 1- Income earned while a nonresident - I entered the information from box 16 of my W2. Area2 - Nonresident income from Maine Sources do I enter 0 or the same income from box 16 of my w2 ? Are these different ?  If I enter 0  the entire Maine state tax that was withheld is refunded- if I enter the full amount of wages I get a small percentage refunded. Which one is correct?