It sounds like you may indeed have a leak in a drain pipe near the closet, especially if the water is only appearing late in the washing machine cycle....