I'm talking with a girl who had be dumped a few days ago by a friend of mine.
What kind of relationship did they have?
They were dating
Talking to her is fine if your friend does not mind. You don't want to upset him by doing that.
I'm going to ask her out as a way to spite my friend, who I hate.
That is not a thing you should be doing. If he is your friend, why do you hate him? Do not do things to spite a friend.