The answer is it depends. Because they are fed regularly, have access to veterinary care is sick or injured, and are not subject to predation many animals live longer in captivity than they would in the wild. Whether their life in captivity is better quality is a different question.
However, some animals simply do not cope well with being in captivity and die much sooner than they would in the wild. For example, zoos have tried to keep the Mountain Gorilla in captivity but these animals fail to thrive in a captive environment.
Another factor to throw in the mix is whether the animal was wild caught and brought into captivity or whether it was born in captivity. As a general rule animals born in captivity, having known no different, may survive better there. However, this is just a contributory factor and not a direct linear correlation.