The law of the Lord is not Jewish nor is it gentile. Ir is truth. God gave the law during old testament times by writing it on stones. It was of the flesh--it was communicated to man through his flesh. As Matthew 5 points out, the law did not change with Christ, but how it is given to us changed. Now it is the spirit of the law, and the rest of Matthew 5 explains how that changed the aw. We are not to use symbolism of the law an more, no more cutting flesh and eating only clean food, but we are to listen to the spirit of the law.It would be helpful if we considered Matthew 5, Acts 15 and Galatians 3 together. We have to let "Scripture interpret Scripture".
Jesus' words in Matthew 5 regarding the Mosaic Law were directed at a (mostly) Jewish audience. He pointed out that He did not come to destroy the Law, but to fulfil it.
In Acts 15, the Church leaders decided that Gentiles should not be bound to the Mosaic Law, but rather they should observe these four things: don't eat meat that has been sacrificed to idols, avoid sexual immorality, do not eat blood and do not eat anything that has been strangled.
In Galatians 3, Paul, speaking to Gentiles, wrote that the Law doesn't make us righteous before God, but rather our faith & trust in Christ.
So, Jesus' and Paul's words regarding the Law work together, not against each other.
Because gentiles who accepted the true God needed o learn about him at the synagogue, they were told to obey the parts of the Mosaic law that allowed them to go to the synagogue to hear God's word, as explained in Acts 15.