Both stories deal with power relationships between colonizer and the colonized. In the Orwell story, the "revelation" is that the Burmese are the ones who wield the true power; as a "sahib," Orwell must do what is expected of a sahib, whatever his personal inclinations might be. As he says in the conclusion of the story, he did what he did to "avoid looking the fool."
In the Lessing story, Gideon also possesses power over his colonial masters, in the form of his knowledge of medicinal plants. His decision to not share the secret of the root he used to save Teddy's vision with the white doctor is based on a desire to protect the knowledge of his people from appropriation and commodification.
In the same way that Orwell is grateful that the elephant killed a person, in that it gave legal justification for his decision to shoot it, there is a sense that Gideon is grateful to be known as just "the boy in the kitchen" rather than the son of a famous witch doctor. In both cases, their respective roles as master and servant allow them to preserve some core value: in Orwell's case, his dignity, and in Gideon's case, his identity.