Since you did not make the contribution to the 529, you should not claim it on your tax return. The deduction belongs to the grandparents. If the grandparents want to give you money for your child's education, you can then donate some or all of that money to your child's 529 plan and take a state tax deduction for it, if it qualifies.