I think the relationship example you gave, or the one you currently have with him are a great examples. For instance, let’s look at the opposite as the solution: spend more time with him in prayer and God’s word to see your relationships grow as fellow disciples of Christ.
For me, this one is a little hard as I don’t have the perspective that you have in talking with him. Do you feel he earnestly wants to do the right thing by the Lord, or wishes to uphold divisive beliefs and wants someone to affirm him in them? If it’s the latter, I’m curious what could have pushed him into this direction, while rationalization is something we can all struggle with in a desire to affirm ourselves. There was a time I personally struggled with the same overwhelming impression of trying to keep up with every little sin in order to be perfect, that I turned to a loose, Ecclesiastical lifestyle (Eccl 8:5), which led to much more sinful living and some darker days in my life.
I think Paul speaks well to this perspective of how fellow believers should work at being holy as God is holy:
1 Corinthians 9:24-27 NASB
 Do you not know that those who run in a race all run, but only one receives the prize? Run in such a way that you may win.  Everyone who competes in the games exercises self-control in all things. They then do it to receive a perishable wreath, but we an imperishable.  Therefore I run in such a way, as not without aim; I box in such a way, as not beating the air;  but I discipline my body and make it my slave, so that, after I have preached to others, I myself will not be disqualified.
Our faith is definitely not earned by works, but there is so much in our broken world that distracts us from the truth. The aim is not so much in willing oneself to be perfect, but to better attach ourselves to the One True Vine that gives us our spiritual fruit, enabling us to live holy lives. It’s a part of the process of Christ’s sanctification in us to seek out holiness in the right way rather than trying to either force it, or just idly not doing anything. Firstly, we cannot be like Him by ourselves, so I see prayer and studying the Word as the primary lifeline to becoming Christlike: to fill myself with Him as I’m already too full of myself, and the rest of the world. Secondly, it is with a humble Spirit that I wish others to also desire greatly to worship the Lord through their prayers and study of His Word.
Is there a possibility to encourage this friend by doing a Bible study together (like maybe Romans) that may perhaps soften his heart to the truth, which may encourage him to leave behind foolish teachings? This could be an opportunity to put into practice what you already know to be true, and help him get aligned with a similar heart as you strengthen each other in the Word of Truth.
Praying for your words and heart as you help out your friend!