Absolutely. And definitely either go to a program that grants a masters or offers that as an out.
You might also have to do it the other way and get the Master's and then if it really excites you get a PhD. At least some Masters programs offer TAships which will cover much of your costs and more so in STEM fields, but it will really depend on the program and your field of study.
The key issue will be that many graduate programs in STEM have some requirement of a degree in a STEM field, though not all.
I'd find a program that interests you and reach out to the Dean or Admissions officer and have a frank conversation. They'll be able to tell you what the steps would be and the likelihood of funding, etc. They should also have some understanding of what their students do and be able to offer some idea of how relevant the degree will be to your interested career path.
As someone who has done some hiring, I don't really care what your undergraduate degree is in if you have a graduate degree. Similarly, if you've been working in the field doing something related to the position, most employers aren't going to care about your undergraduate degree. Though depending on where you're interested, HR may be a problem.
The last option would be to seek out someone at a company of interest and meet with them. If you have enough of a foundation in their required skills, see if they'd let you do an internship. It might be unpaid, though companies are increasingly under pressure to at least pay minimum wage if you're really doing work. That would let you get a sense of the work. And either way it will reaffirm what skills you'd need to hone up on if you find you're falling short.