RUIRU, Kenya — Before last year, Richard Ochieng’, 26, could not recall experiencing racism firsthand.

Not while growing up as an orphan in his village near Lake Victoria where everybody was, like him, black. Not while studying at a university in another part of Kenya. Not until his job search led him to Ruiru, a fast-growing settlement at the edge of the capital, Nairobi, where Mr. Ochieng’ found work at a Chinese motorcycle company that had just expanded to Kenya.

But then his new boss, a Chinese man his own age, started calling him a monkey.

It happened when the two were on a sales trip and spotted a troop of baboons on the roadside, he said.

“‘Your brothers,’” he said his boss exclaimed, urging Mr. Ochieng’ to share some bananas with the primates.