I would echo the same advice already given by others.
You may use that existing container as a cache pot if you still have preference for that..but the plant itself should be in another container with drain holes. Yucca is quite a slow growing plant and by this time your plant is doing a slow death since media has not been flushed out of potential pooled water inside and salts.
But I still see some green leaves..and if that cane remains firm to your touch and has no mushy part, then maybe there is still a chance to salvage it.
They do like to drink water especially in summer which is its active growing period, ideally in an area that is also very hot and dry, and that is why they are typically grown outdoors in full sun, since it has very high heat and drought tolerance.
In your case, your plant is being grown indoors, unable to drain excess water, and is not getting as much light. Hence it is also manifesting thru its leaves inability to get proper moisture and airflow at the rootzone, since roots may have already rotted for soaking too long in wet media or due to the perched water table inside the container when the drain hole was blocked.
So improve the cultural growing conditions..repot in a container with drain holes, do not plug the drain holes with rocks..just use a mesh or even a coffee paper filter to cover the hole to save the soil, add pumice to your media to increase porosity and airflow at the rootzone. If you find it hard to gauge how much water to utilize, try using an improvised water spike. I did that to my Yuccas and it was enough for what they need. By water spike, you can use an old water bottle, put a cloth or foam cover on the main opening and cut the other end of the bottle, do not cut all the way, just enough that you can flip that back part so you can refill water as needed. With the bottle tip upside down, stick it into the soil, so water goes direct to the soil. At times one whole bottle is enough. Or you can get a terracotta water spike holder, and just turn the bottle upside down, no need to cut the other end of the bottle. It will still passively water the rootzone as needed.
When they are grown indoors, they will not be as active in growth like the ones outdoors since the dynamics are different. So got to be careful they do not end up being overwatered.
If you do not like using a water spike, then just make sure you water thoroughly and allow excess water to escape. Use bamboo skewers to test the soil to see if media below has truly dried out. If skewer comes out still wet delay watering another day.
As the seasons change you may further lengthen the intervals of watering especially during the cold season when light levels are naturally shorter and intensity weaker. Indoor grown plants also slow down in growing..so do not overwater..maybe at most once a month, all depends on the temperature you have indoors and light levels.
To give you an idea about water spikes..here are my Yuccas. But I grow them outdoors, and the water spikes helped quite well. Before Yucca would easily have brown dried out older, lower leaves. This time it is holding well the older lower leaves and continues growing new ones at the tips.
This is the mother plant
And cutting I took two years ago..and now thriving much better. If you look closely at the base of the plants, I have water spikes there. As long as there is still water in those spikes then I wait till the plant uses it all before I refill again.
They have endured recently our week long excessive heat conditions here that was reaching highs of 116F at times..so it was really thirsty.
Good luck on your plant. It would be also simpler to just find a different container with drain holes and use a saucer to catch excess water. Your plant is big so it may be too heavy if you do the cache pot method.