“For African-Americans, even more was riding on their march west,” Mr. Katz wrote in his book, “The Black West” (Mr. Katz was white and grew up in Greenwich Village). “More than Europeans, pioneers of color pined for a home of their own, a place to educate children, protect women, and nail down elusive dreams.”

But the number of black cowboys in the city has dwindled since its heyday in the 1980s, when New York was home to the Black World Championship Rodeo, a festival of bucking horses and steer roping. The event took place in both Harlem, at Col. Charles Young Park (named after an early 20th-century African-American cavalry officer) and at Floyd Bennett Field in Brooklyn.

In 2016, the Federation of Black Cowboys, a group dedicated to teaching cowboy history, lost the stable it had run since 1994 in Howard Beach, Queens. The New York City Parks Department awarded the operating contract for the facility to a therapeutic riding organization, after several horses died in 2013 under the federation’s care.

Today, staking their claim in the American story has become more essential than even riding or roping. “It’s sad, but we still exist, we still go to schools and educate the youth on the legacy,” said Kesha Morse, the federation president, who added that the organization still keeps four horses stabled privately in Queens. “The mission was not to just have horses and ride horses; it was to educate.”

Nationwide there have been small steps to correct the record, particularly in popular culture. The celebrated “Watchmen” HBO series opens with the frontier lawman Bass Reeves, who is the inspiration of one of the show’s heroes, and a wild West aesthetic called the Yee-Haw Agenda has caught on among some young black influencers. In 2016 the Studio Museum in Harlem ran a photo exhibition on the subject; the following year the Museum of the Black Cowboy opened in Rosenberg, Tex.