Can I claim non-working spouse IRA contribution on a state return we are not residents of but own rental property (that is income generating)

Can I claim non-working spouse IRA contribution on a state return we are not residents of but own rental property (that is income generating)? Spouse doesn't work so we can contribute $6000 to her IRA and get a write off. We have an income generating rental property in CA. We live in TN. Can we claim this deduction in our state tax return to offset the income so we don't have to pay CA state taxes? Turbotax is letting me do that, but I don't know if its legal.