MILAN—Gucci boosted its brand and sales by using social media to flaunt its connections with hip-hop artists and promote its theatrical fashion shows, but that momentum reversed in February, after the release of a sweater that critics likened to blackface.

The result: Gucci lost the top spot among luxury companies for social-media engagement in March, according to Tribe Dynamics, and in July it reported its first quarterly drop in North American sales since early 2016.

The...