If there is cast iron under the slab, it is most likely connected to the sewer. It may have been disconnected. I don't think it's connected to any drainage. If it empties a lot into the well, it could fill a drainage and cause it to backflow. If it drains when water is poured into the pipe, take food coloring and dye a bucket of water, pour it in, and try to see if it goes to the sewer or somewhere else outside the house, like a stone well or similar.