Yes, if you were only temporarily away from Illinois to work in New Mexico, you would still have to pay taxes on the income earned in NM.
In general, your home state will tax all income from all sources. What you will do is you will file a nonresident return for NM that you do not reside in, but you visited for work and earn money in. When you file, you will fill out your nonresident state first. Then you will fill out your Illinois state return, claiming a credit for taxes paid to NM on your IL return. You may or may not still end up owing money to IL depending on whether or not their tax rate is higher or lower than your NM. If the NM had a higher tax rate than your IL rate, your credit will be limited to the amount of tax you would have paid to IL. They will not give you a refund of the taxes you paid to the nonresident state.
Multiple States
File Non Resident State Return
**Say "Thanks" by clicking the thumb icon in a post
**Mark the post that answers your question by clicking on "Mark as Best Answer"