Answer:
Both push a group to the periphery of society. It creates "the haves" and "the hand nots." Both can create a misplaced sense of guilt or shame. They deny society of the best that the isolated group can share. They leave a group short suited, and can create a sense of conflict.
Some of the elements which can be considered to be gothic in "the pit and the pendulum" are darkness, internal struggle, horror and terror experienced by the main character, lack of freedom, torture, etc.