I am not an ecologist. However I believe that endangered species can be kept out of reach of their predators to ensure that they do not become extinct. They can be kept in zoos or such secluded places for such a purpose..
I think that it is possible. Of course it depends on the species. In some cities in the world some micro-reserves are being created to avoid or prevent the extiction of species and to preserve some "pieces" of the original ecosystems.
The answer will totally depend on the species and its ecology, and why the species became endangered. For some species the habitat requirements can be met in an urban setting. Species that in the wild need large tracts of land without human influences can only be sustained rather artificially in cities. Often the real value of the species is as a functional component of its native ecosystem, and that usually cannot be reproduced in a city. For example, if polar bears are an endangered species, yes, they can be kept in a zoo. But if the value lies in the whole ecosystem that includes polar bears, ocean ice cover, seals, fish, berry bushes, denning sites, etc. then this cannot exist in a city. A little limestone barren flower can be grown in a garden, but this is artificial unless the limestone barren itself is present with its distinct geology, seasonal patterns of soil freeze and thaw, and the other plants and animals that would inhabit such an ecosystem. In my opinion sustaining a few individuals and even breeding them in a highly artificial setting isn't really preserving the species if its functional niche in the wild is being lost. The ecological niche a species exists in should be considered as important as the members of the species itself.