I disagree with those referenced who'd say an ass-kicking isn't a proper shoot. In some cases, no, it's not, but I don't think that should be laid out as a bright line rule. Circumstance like this I think you'd be justified. Even in a "fair" fight, it's wise to deploy your resources while you still can. A fair fight means you have just as much a chance of going down as the other guy, at which time you don't know what happens. Your average scrap where you've got friends (or at least people with a conscience who can intervene) or some situational control is a different story. But anyone who's ever been in a bad situation - attacked from behind, superior numbers, dramatic disparity of size, and so forth - can tell you that things get out of hand much faster than you can process and there is no guarantee they're going to stop short of maiming you or worse.
The situation details will vary and require consideration. So will the law - it's not only death, but serious bodily harm, and in some places substantial losses of other natures that justify deadly force. I don't think it's out of line to generalize that to say: If it's at all reasonable to conclude there is a substantial chance you could require hospitalization or worse, it is probably fair to deploy what you've got when you can. That doesn't mean empty your mag immediately, but try to stabilize and defuse the situation before you lose the ability to.