Maryland double taxed income

Hi,  I worked in NJ for the first 5 months 2019, then started a new job in Maryland since June 2019.  I moved to Maryland in Sept.  When I do my tax return, first I entered Maryland income, and I got tax credit based on my Maryland income.  Then I entered NJ's income, my tax "credit" in Maryland becomes to be negative (i.e., additional tax is added for Maryland based on NJ's income).  I feel that my NJ income has been double taxed in both NJ and Maryland.  How should I do?