It is not at all uncommon for ideas to hit two entirely different and unrelated people at the same time, and they work those ideas up entirely independently.
So, well-along in the process, you discover that someone else is doing the same work. This is not plagiarism. I cannot begin to tell you how many patents are filed virtually simultaneously for the same design, developed entirely separately. Ideas are wandering around out there, and if you had the idea, chances are someone else did too.
It BECOMES plagiarism if, now that you've seen this other work, you co-opt it and claim it as your own.
Your problem is to fend off the appearance or "stink" of plagiarism, because the other researcher was in a very close milieu to you, and it would be easy to impute that you had opportunity. My advice: include an acknowledgement of the other work, with a brief precis of how it is similar and how it is different: i.e. you arrive at the same conclusion via dissimilar methods.
The strategy here is for you to do the "entanglement" of the two ideas yourself, control how it is presented and perceived, as you and this other researcher co-attributed, following independent but similar lines, instead of letting the greater community decide something decidedly less charitable for you later.