I am sorry to hear that your yucca is not doing too well.
It is hard to tell from your photo. Apart from needing to be repotted and given a good watering, it looks like it will be ok. Is this the stem that you are referring to?
Something else to consider is to give the roots a bit of a trim (remove the sections that appear to be circling around the pot) and then repot it and give it a good watering with a diluted fertiliser concentrate like seaweed emulsion. Please remember though that the pot should be well draining.
Good luck with this and I hope this helps.
Please ensure that you check back with any other questions or just to let us know how it is going :)
I am so sorry for the slow response to your post :(
It appears to me that the problem is most likely a fungal problem causing the black spot symptom. Common treatments for this include copper based fungicides; I have had success with this treatment on other plants. While I have not tried it, I have also heard and read that Neem oil treatment can also be successful.
Here is a link for making your own copper based fungicide. I hope this is helpful :)
Once again, I apologise for the slowness of this reply.