Do I need to pay capital gains and dividend taxes in a state where I worked remotely for about 4 weeks?

In 2020, I was a resident of Indiana (and then New York when I moved there permanently in August), but I also spent about 5 weeks in New Mexico as a nonresident. I worked remotely in New Mexico for my Indiana job for about 4 of those weeks.

 

While I was in New Mexico, I received some dividend/interest income from various mutual funds and ETFs. These funds regularly pay dividends/interest throughout the year, usually on a monthly or quarterly basis.

 

Do I need to pay New Mexico income taxes on those dividends/interest income? For instance, I received some capital gains from a mutual fund in New Mexico while I was visiting family for Christmas, since this fund distributes capital gains at the end of the year. (I didn't sell the fund--the fund itself produced some capital gains through its own stock sales.)

 

Thank you for your assistance!