Worked all year for NY company, part year NJ resident then moved to NY for rest of the year

Hello ,

I lived in NJ for a few years, for Tax year 2022, I lived in NJ from Jan 1, 2022 till Apr 15, 2022 and then I moved to Long Island, NY. No county or local income taxes in either place.

My wife and I were continuously employed all of 2022 i.e. we did not switch jobs. She was employed by Employer A and I was employed by employer B. Both employers had office in NYC. We worked remotely most of the year. Wife's employed switch to hybrid schedule in the latter half of 2022, requiring her to come in to NYC office. 
In W2 box 1 "Wages, tips and other comp." I have $150,780, box 12b has code D with amount $20,400. Adding these two matches the amount for Gross pay on W2, i.e. $171,180.
The W2 from employer for NJ state reports NJ Wages. as $46,186 but nothing under state income taxes.
The W2 from employer for NY state reports NY Wages as $150,780 (i.e. all income) and $9185 under state income taxes.
I looked at the first few paystubs of Jan, Feb and mar 2022 and all of them say "NY withholding Tax" , even though it also notes "State of Residence" is NJ , "Your work state" is NY, "Your work location" is New York.
I can retrieve and look through. paystubs for the. rest of the year as well, but I'm pretty sure they all say the same thing except that the "state of residence" will change to NY after my move.

I filed taxes last month and I made a couple of mistakes that I now need to correct. I assumed that I can deduct NJ reported income (46,186). from the total taxable wages (150,780) and report it as NY income. i.e. 104,594. 

I also assumed that the taxes were all withheld by NJ , but now it looks like it may have been withheld by NY instead.

I received a notice from NJ wanting to verify details as the refund amount is unusually high. 

Can some one please advice on how to allocate income to NJ and NY respectively and also how to determine if the taxes reported in W2 actually went to NY or NJ ?

Basically, I am looking at filing an amended return.

Thanks,
Pankaj