Assume while someone writing his/her master's thesis, he/she found that there was a very similar paper to his work (90% similarities) 3-5 years ago? Does that make a problem and how to tell your advisor about this?
There is no question about how to tell your advisor. Just do it. He or she will help you decide what to do. If the work is independent and the other paper is obscure enough you might have no problem with your degree, but might not be able to publish this work as is.
Not to tell your advisor would be a serious breach.
However, if it is work that you should have known about (literature search, etc), then you may be unable to use it at all and have to revise your research plan. An extension of the work might be one option.
At the doctoral level the answer would be a bit different, leaning more toward abandonment of the work, but, depending on your advisor and any committee involved, you may be ok.
I'll note here as I have other places, that parallel work (and overlapping work) is very common, especially in fields with a lot of research activity. Your advisor will know about this, I'm sure.
The age of the other work is a bit of a problem, of course, but it can reasonably happen this way in certain cases.
Breathe very, very deeply.
It's very easy to succumb to panic when something like this happens. However, panic is not a reaction that will help you respond appropriately to this situation. You need to be able to see the newly-found work from a calm and neutral stance to really evaluate which elements of your work are already present in the literature, which elements are untouched, and which elements are present in the newly-found work but can be improved upon with your work.
None of that is easy, but none of that is really doable from an anguished emotional standpoint, so: breathe, take it easy, put it to one side, and go to bed and sleep on it. After which, though:
Take this to your advisor ASAP.
Your advisor is there to help you solve problems in your research. This most definitely rates as a problem, and you need someone with experience to help you deal with the response. (As others have pointed out, it would almost certainly be unethical to withhold this information from your supervisor, but more importantly: it would be stupid to deny yourself your greatest source of help in dealing with the problem.)
Depending on the circumstances, it can indeed be the case that you are at fault for negligence in carrying out your initial literature review. (And that assumes that the newly-found paper really is that close to your research; as above, though, a calmer examination will often show a much larger distance.) However, it can also be the case that it was simply a hard problem to find the right literature in the first place.
As an example, it's a reasonably general principle that it is often extremely hard to find the solutions to problem X in the literature until you've actually solved the problem yourself, because having the solution in hand, and being able to examine the key methods, ideas and structures that make it work, opens up a whole new field of keywords to search for, and this can lead to finding literature that uses those things to solve a minor variant X' of your problem that you didn't (couldn't?) think to search for. If this was the case, then it's a Standard Hard Thing About Academia, and you should count yourself lucky that you encountered it at a master's level where the consequences are not that catastrophic.
However, telling which of those cases your problem falls into is not something that any of us can tell you, and it is not something that you should attempt on your own without telling your advisor. When you meet him/her, you should explain in depth which aspects of your research you think are reported in the newly-found paper, as well as how you came to find it, and why you think you missed it on your initial searches.
As to how to tell your advisor, I would advise you to send them an email ASAP, saying that you need to meet with them in person as soon as possible because you found a previous publication that includes some aspects of your work, and include a copy or reference to the work. Your advisor will be able to offer much more helpful advise if they've had time to see and digest the new work before you meet with them in person.