I actually had conversation with my wife about how well a .40 cal would fair against a gorilla and I said I had no idea what the outcome would be but I wouldn't be shooting from close
It's interesting that the conventional wisdom is that you need at least a .30-30 Winchester rifle round to take down a 150lb whitetail deer that wants nothing to do with you, but when I started on the job, my .38 Special revolver was expected to stop a 350lb lunatic human bent on killing me.
The first cop on-scene in Connecticut where the Chimpanzee mauled the woman and ate her face shot the Chimp with a .40 S&W round. It immediately retreated back into the house, where it died shortly thereafter.
If an animal (I was going to say wild, but then remembered about Pit Bulls) threatens me or anyone in my family, I'm firing until lockback, then reloading and firing until lockback again if there's still a threat.