Overflow from washing machine drain pipe while showering
Recently after showering I went down to the basement to find a large amount of water. I've lived in this house for 6 years now and this has never happened before so needless to say I was surprised and there was no obvious drip or source. Today while my roommate was in the shower I stayed in the basement to find the source. It ended up coming from the washing machine drain pipe (there is no washing machine just the open pipe).it started slow then poured continuously. So I found the source and actually plugged it with a t-shirt which stopped the leak completely. I know this isn't a good permanent fix but helps for now. Is there some sort of cap I can get to fix this problem or is there a clog that needs to be fixed before I would cap the pipe? Also some small pieces of toilet paper came out before I stopped the flow.
FYI:
I live in a city, connected to city sewer, not a septic. The shower is on the second floor and the leak in the basement.
Thanks in advance for any help!