This month, as the patient lay anesthetized on a table, a cardiologist made a half-inch incision through the skin of his chest. She removed a small implanted heart monitor with failing batteries and inserted a new one.

The patient, like many older males, had been diagnosed with cardiac disease; the monitor would provide continuing data on heart rate and rhythm, alerting his doctors to irregularities.

Closing the incision required four neat stitches. In a few hours, the patient, a gorilla named Winston, would rejoin his family in their habitat at the San Diego Zoo Safari Park.

“Winston, at 51, is a very old male gorilla,” said Dr. Matt Kinney, a senior veterinarian at the San Diego Zoo Wildlife Alliance who led the medical team through the procedure. With improved health care, new technology and better nutrition, “we see animals living longer, and they’re healthier for longer, too,” he said.

In “human-managed care” (the term “in captivity” doesn’t fly at zoos anymore), gorillas may live two decades beyond the 30- to 40-year life spans that are common in the wild, and longer than zoo gorillas did in decades past.

As with their human relatives, however, aging also brings chronic illnesses that require testing, diagnosis and treatment. Gorillas are prone to heart disease, the leading cause of death for them as for us.

So now the questions for Winston’s caregivers resemble those that doctors and older human patients confront: How much treatment is too much? What is the trade-off between prolonged life and quality of life?

Geriatric wildlife care “has gotten more and more sophisticated,” said Dr. Paul Calle, the chief veterinarian of the Wildlife Conservation Society, based at the Bronx Zoo. “The medical and surgical knowledge of people can be directly applied.”

It looks more like human geriatric care. To keep gorillas healthy, zoo veterinarians not only turn to technologies and drugs developed for humans, but also consult with medical specialists like cardiologists, radiologists, obstetricians and dentists.

Winston, for instance, takes four common heart drugs that people also take, though at different dosages. (He weighs 451 pounds.) The heart monitor he received, smaller than a flash drive, is implanted in humans as well. Winston received his annual flu shot this fall, and he is undergoing physical therapy for arthritis.

“We’re looking to provide comfort to these animals later in life,” Dr. Kinney said.

That doesn’t come cheaply: There were nearly 20 doctors, technicians and other staff in the operating room when Winston received his new monitor. But the San Diego Zoo Wildlife Alliance, parent organization for the zoo and the safari park, covers Winston’s care through its annual operating budget. Donors and partners offset some additional expenses.

“None of our animals have insurance, and they never pay their bills,” Dr. Kinney noted.

Several of Winston’s longtime caregivers, called wildlife care specialists, have retired. But Winston, who has achieved silverback status with age, remains on the job, managing his “troop” of five gorillas, keeping the peace and intervening in squabbles when needed.

“He’s such a gentle silverback, an incredibly tolerant father,” said Jim Haigwood, the curator of mammals at the San Diego Zoo Safari Park. “His youngest daughter, he’ll still allow her to take food out of his mouth.”

The zoo has twice introduced females with sons to the troop, which in the wild might lead to infanticide. But Winston’s caregivers believed he would be accepting, and he was.

“He raised those males as though they were his own sons,” Mr. Haigwood said. (Once they became rambunctious teenagers, however, they were resettled in their own habitat, an option that human parents might occasionally envy.)

Winston, a western lowland gorilla native to Central Africa, arrived at the San Diego Zoo in 1984. He enjoyed robust health until 2017, when his caregivers noticed “a general slowing down,” said Dr. Kinney, who arranged Winston’s first echocardiogram.

The test showed only “a couple of subtle changes, nothing alarming,” Dr. Kinney said. Everyone was relieved. Normal aging.

Then in 2021, the whole troop contracted the coronavirus, probably transmitted by a human. As in human patients, age mattered.

“Winston was the most severely affected,” Dr. Kinney said. “He had a cough, pretty significant lethargy, lack of appetite.” He began holding on to objects as he walked.

After an infusion of monoclonal antibodies, Winston recovered. Now the whole troop has been vaccinated and boosted against the virus.

But while Winston was being treated, the veterinarians and human doctors ran other tests that found concerning health issues. Winston’s heart had begun pumping less efficiently; that led to a daily regimen of blood pressure and heart drugs hidden in his food, and to the implanted monitor. He also takes ibuprofen and acetaminophen for arthritis in his spine, hips and shoulders.

More worrying was a CT scan and biopsy showing a cancerous tumor damaging Winston’s right kidney. That prompted the kind of risks-versus-benefits conversation that should inform decisions about invasive treatment for older patients, but that is often skipped for humans.

“Do we do a surgical procedure?” Dr. Kinney recalled wondering. “The big concern was, what would the recovery look like?” After considering Winston’s age and life expectancy, and determining that the tumor wasn’t growing, “we were comfortable with continuing to monitor him,” he said.

For now, “we’re at a good balance,” he said. That is not entirely a medical issue, but reflects Winston’s ability to lead his troop — including a female, Kami, with whom he has had “a very devout partnership” for 25 years, Mr. Haigwood said.

Some aspects of healthy aging might come more easily for zoo primates than for people; their keepers provide only healthy choices. “They’re not smoking,” said Marietta Danforth, the director of the Great Ape Heart Project, a research effort at the Detroit Zoo. “They’re not eating cheeseburgers.”

Winston’s vegetarian diet consists primarily of tree branches and root vegetables. The half-acre Gorilla Forest where he lives, with its hills and pond and climbing structures, promotes exercise.

Still, geriatric care necessarily involves end-of-life decisions. Winston could die a natural death one day like Ozzie, a gorilla who died at Zoo Atlanta two years ago at 61, or Colo, who was 60 when he died at the Columbus Zoo in Ohio in 2017.

But if his quality of life declines, if he stops interacting with the troop and his caregivers or begins suffering, parallels with human care end. Even in California, with its medical aid in dying law, euthanasia remains illegal for humans. It is an option for Winston.

“It’s a privilege in veterinary medicine,” Dr. Kinney said. “It also comes with great responsibility.”

If Winston’s doctors, specialists and caregivers conclude, after extensive discussion, that a painless death would be preferable to a diminished life, “it’s a very calm process,” Dr. Kinney said. After an overdose of anesthesia, he said, “within minutes, there is cardiopulmonary arrest.”

About 350 gorillas — and 930 great apes in total, including bonobos, orangutans and chimpanzees — live in U.S. zoos, Dr. Danforth said. However well cared for they are, some animal rights activists and primatologists argue that they don’t belong in zoos.

But even People for the Ethical Treatment of Animals, whose position is that wild animals belong in the wild, acknowledged in an email that zoos like San Diego’s, accredited by the Association of Zoos & Aquariums, meet high standards of animal care.

Winston “has had high-quality years,” Dr. Kinney said. The gorilla has also become a beloved media personality. San Diego will mourn his loss, whenever and however it happens.

For now, “we want to be sure Winston is living a good life, that he’s fulfilled,” Dr. Kinney said. “We have a good understanding of what makes Winston Winston.”