Publishing a paper - not enrolled in university
No, you do not need to be enrolled in a PhD to publish scientific papers. You don't need to be a professor either. It's common, but by no means mandatory. For example the game Arimaa was invented by Omar Syed. He published a paper introducing the game and has never earned a PhD.
As for how to publish - it's no different from those who have PhDs. Go to your target journal's website; it will have instructions for authors on how to submit the paper.
You say that you have a masters degree. So you have an affiliation with the university where you have studied. It may be possible to use this. You could talk to your masters degree advisor or the head of the department and try to find out (Especially if perhaps you got the research idea or some work done there as a student).
If you tried to submit to ArXiv for example, you'd be asked for your affiliation. So affiliation may be more important than a PhD.
You may contact the journal and ask them directly. In my opinion, if your work is good, the journal should make an effort to publish it.
There is no qualification required to submit a journal to an academic publication. Most journals allow you to create a profile on their submission website and submit papers at will. The profile information for academic journals generally allows a range of titles (Mr, Ms, Dr, Prof, etc.), and this anticipates the fact that some submissions will be from people who do not have a PhD. Most good journals use the practice of blind-review, so the referees will not know who the author is, or what qualifications the author has, or lacks.
If you would like to submit a paper to a journal, search for their submission page online, create a profile, and then undertake your submission. All you will really need is an email address for them to correspond with you, and a healthy sense of self, for dealing with inevitable rejections!