LA VEGA, Venezuela—This nation’s slums have been the backbone of the leftist government for decades, and one of few remaining bulwarks for President Nicolás Maduro. They are now turning on the embattled leader—a shift born of economic misery and police violence that could cost him the country.

Support for Mr. Maduro among Venezuela’s poorest fifth of the population has gone from roughly 40% in early 2016 to 18% in February, according to Datanalisis, a respected pollster in Venezuela.

With...