But if you call yourself a Jew and rely on the law and boast in God...
Romans 2:17 ESV
The Law is not intended to be your advocate, so you can't depend on it to defend you in God's court. The Law is the standard by which you will be judged. It teaches you how to behave and love, but the only testimony it can offer in God's court is how you broke it.
Nobody is justified in God's sight by virtue of his ancestry. Covenants are inherited, but righteousness is not.