From the entry of :
> ※1892()
So the word form is attested at least since late 19th century.
As you said, this is a combination of + . can be traced back to the 10th century and to the 18th century with basically the same meaning as in today (interjection of amazement).
> ※
>
> ※1777
Thus it should be natural to assume that it has developed independently from the Malay phrase, and their resemblance is a coincidence. Of course, one can argue that the either side of people learned the specific word used in the other and mimicked the phrase by a novel combination of native components, but that would be difficult to prove or disprove.