The fact that you went to your employer first, and you made it clear that you didn't want to leave, both go a long way to mitigate the possibility of bad emotional reactions. (They don't eliminate it, but they mitigate it.) And they put you in a position to renegotiate your salary. Furthermore if it doesn't work, your fallback is a new job at higher pay.
Be warned, though, that this is a bullet you can only fire once. Having done it, you've burned some social capital. If you keep going back to that well, your employer is going to eventually cut you loose.
Also be warned that if you have actually accepted a job elsewhere, you should never accept a counter-offer. In that situation your employer will be willing to offer a lot because they are desperate, but they know that it is just a question of time until they lose unhappy people. So they will work to replace you, and it is just a question of time until you are fired with no job offer in hand.
That's why if you try this it is critically important to go to your employer with the message that you want to stay, but (financial situation X) is a problem for you. (It helps, a lot, if the financial situation is both real and known to your employer.)
Your boss may find the money, or your new job will pay more.