I think that both answers from JaredBh and OmukaiAndi could be correct. It really just depends on the exact context of the scenario that the OP is describing.
There is a slight ambiguity in the original question because the phrase “stay with me” in this situation (a character on the brink of death) could have two different meanings. Something along the lines of:
1)Hey, don’t die on me yet! Stay with me!
2)Please don’t die. I want you to stay with me!
In the first example, the “stay with me” is more of a "hang in there! Be strong! [don’t lose consciousness]. Stay with me [alive, here in this world], in which case, JaredBh’s answer would be appropriate. In the second example, the “stay with me” is more of a “I want to live by your side/I want you to live by my side” in which case OmukaiAndi’s answer would be good (I’ve also seen 傍に in place of 側に).
Or even better yet. Maybe the scenario incorporates BOTH “stay with me”
-Character 2 is on the brink of death. Character 1 tries to support character 2-
C1: Hey, don’t die on me yet! Stay with me!
[after a moment of C2 not responding].
C1: Please don’t die. I want you to stay with me!
In this case, perhaps both of the above answers are used! It’s a win-win for everyone! xD
P.S. I apologize for adding life to the necro’d thread. Just happen to see it on the recent community posts and wanted to add my two cents.