CA and AZ Both Taxing AZ Source Capital Gain

Hi.  My issue is I am being taxed twice on AZ source income (capital gain) since I am now a resident of CA.  I sold my AZ home in June 2023; however, I became a resident of CA end of May.  So CA is taxing me on all my source income including the home sale since I am a resident of CA now, and AZ is also taxing me on the capital gain since the home was in AZ.  I did not qualify for the capital gain exclusion.  Can I file forms 301 and 309 to get a tax credit from AZ for the double taxation amount? Or should I file CA Schedule Schedule S to get the tax credit from CA?  I am filing a CA Form 540NR and AZ Form 140PY.