I assume the pipe is PVC. The safe way would be to use a hair dryer on the pipe. But this is probably not quick enough if you are about to be flooded.
For now, I would cut the pipe and reconnect Temporarily with a glexible hose until the flooding subsides.
Once the pipe is thawed, you will have to take care of this problem so it doesn't occur again. Most of the time, these pipes freeze from the outside end inward. You may need to correct the outside drainage or reposition the pipe.
Make sure the end of the pipe is free so that water will fully drain away from it. If water is allowed to accumulate at the end, freezing will occur again in the future. Also, make sure the pipe is angled downward once it begins to exit your house. This is so ALL the water beyond the heated interior of your home fully drains out each time