No. It doesn't matter where you working when you contributed to your 401(k). What matters is what state were you a resident of at the time of the withdrawal. If you weren't a North Carolina resident when you "cashed out", it's not North Carolina income.