Yes, the Gentiles had the Law written upon their hearts. But this passage you quoted does not mean that the Gentiles ever satisfactorily kept the Law. They did what the Law required in some particulars, not all, for no one but Jesus kept the Law perfectly. All have sinned and come short of the glory of God, therefore all who are not in Christ are under the condemnation of the Law. The law requires perfection But now, there is no condemnation to those who are in Christ Jesus, for Christ is the end (goal, intent) of the Law for everyone who believes.
Our part is not keeping the external commands of the Law, that is not enough. We are to walk after the Spirit, and in this way the righteousness of the Law is fulfilled in us. In this way, we cleanse the inside of the cup, not just the outside. The Law cannot save, it can only point to a Saviour.