Others may have other practices, but my way is to always donate my octo first and share my back gas with a diver in need, just like I would if I had no redundant gas source, provided I have enough gas to get us both back to the surface (which should be the case if my gas plan was followed--but that's another conversation). My thinking in this is that if we can both get back to the surface on my back gas, then my pony is available for me to use on a second dive.
Some may advocate passing off the pony, which certainly can be done, but I consider the pony MY emergency reserve. What would you do if you passed off your bottle to someone else and then had a catastrophic failure of your back gas yourself? Similarly, if you donated your pony reg first and had that same failure, you would either need to get that reg back or buddy breathe. Rule #1 in a rescue situation is not become a victim yourself. I'm going to do what I can to take care of another diver in an emergency, but if I'm having an emergency myself at the same time, I've got to take care of myself first.
That may differ from how others do things, but that practice is how I usually see it done, and it works for me.