You will need to discuss with your ex-wife so she agrees that you can claim your kid as dependent on your tax return. This means she will not claim the same child as dependent on her tax return. The child does not have to live with you if that is so said on the divorce decree.
Good Luck!