The first thing to know about marginatas ( the real name of "dragon trees" ) is that wet soil around their roots is lethal to them. It may take awhile (like several months) but if the soil doesn't dry between waterings, the plant will die. If the trunk is wrinkly, soft, and bendy, the rot has entered the stem tissue, and the probability of survival is about 5%. If the trunk is still firm, there is a chance you can save it.
Before anything else, get it into a pot with drainage. If you want to keep the pretty pot it's in, get a plastic pot with drainage that will fit inside the pretty one. Here's a video that tells you more about "double potting."
http://www.youtube.com/watch?v=kG9PImILzh8. You can get plastic grow pots of appropriate size at any local nursery.
Next thing is to always check the soil all the way to the bottom of the pot before you water. The soil should be almost completely dry before watering. When you water, water enough that you get a run off from the drainage holes of about 1/4". You don't need to empty that small amount of water, just don't water again until the soil is almost dry. This video tells more about testing for soil moisture.
http://www.youtube.com/watch?v=Tf-8InSamYQIf you do this, the pathogens in the soil should die off, and the roots will be able to grow again.