Gratitude is a mark of being a Christian, because knowing God must produce thankfulness in the heart of the believer. The work of God's redemption is the ground for our thankfulness. It is through thankfulness that we fight against legalism.
We must be careful not to make our gratitude towards God the ground for our life of obedience. We don't obey because we feel obliged to express thankfulness. However, gratitude does motivate obedience.