Excommunication is an ancient human practice meaning out of communion. Excommunication is a religious censure in which a person or group of people are deprived or suspended from membership in a religious community. Prior to the concept of the separation of church and state taking hold on Earth, the concept had legal and religious consequences, but later it only had religious consequences.
The Furies also practiced excommunication - using it to punish members of their society who had failed in some form by casting them out of society. When being chased by a group of Furies, Captain Kathryn Janeway overheard a Fury leader giving orders to give chase to her, Tuvok, and Neelix - and if the Furies failed they would be excommunicated. Janeway speculated that a Fury who was excommunicated would probably soon commit suicide. (VOY novel: The Final Fury)
In Bajoran society, the practice of expelling a member of the Bajoran faith was known as an Attainder. This form of censure was very similar to excommunication, with those attained forbidden to enter the temple, read prophecies, look into an Orb, pray with others, or even wear their earring. Kira Nerys was attained in 2376 after publishing material the Vedek Assembly wished suppressed. Her attainder was later rescinded. (DS9 novels: Avatar, Book Two, Unity)