The title for this post contains a question mark because I couldn't find anything (although it was a very hasty search and with more time I could find the answer) that explicitly stated that these passages are the biblical foundation of excommunication in the Catholic Church, but it does seem possible.
This is from St. Paul. (2 Thess 3:13-15)
My brothers, never grow tired of doing what is right. If anyone refuses to obey what I have written in this letter, take note of him and have nothing to do with him, so that he will feel that he is in the wrong; though you are not to regard him as an enemy but as a brother in need of correction.
And this is from the mouth of our Lord. (Matthew 18:15-20)
If your brother sins against you, go and tell him his fault, between you and him alone. If he listens to you, you have gained your brother. But if he does not listen, take one or two others along with you, that every word may be confirmed by the evidence of two or three witnesses. If he refuses to listen to them, tell it to the church; and if he refuses to listen even to the church, let him be to you as a Gentile and a tax collector. Truly, I say to you, whatever you bind on earth shall be bound in heaven, and whatever you loose on earth shall be loosed in heaven. Again I say to you, if two of you agree on earth about anything they ask, it will be done for them by my Father in heaven. For where two or three are gathered in my name, there am I in the midst of them.
Definitely something to think about!