529 incentives are completely state based. If you earned income in both states, you could put a total of $10k in per person ($5k in each state plan), and claim the $5k deduction in each state against that state's income. If you did not earn income in both states, this wouldn't work.
I don't know how it works for other states, but in NY, you can only claim 529 deductions that go through the state savings plan.