A black-car driver took his own life outside of City Hall on Monday morning, blaming elected officials for bad policy that ruined his livelihood.

The man, Douglas Schifter, 61, shot himself in the head while inside a rented sedan that he drove up to a gated, Park Row entrance of City Hall at about 7:12 a.m., according to police, friends and industry advocates.

Schifter, from Thornhurst, Pennsylvania, blamed his ailing finances on the growing e-hail industry, which has “flooded” city streets with drivers for apps like Uber, a company Schifter referred to as a “liar, cheat and thief,” in a lengthy public Facebook post published shortly before his death.

“I will not be a slave working for chump change. I would rather be dead,” Schifter wrote in the post. “Bloomberg, deBlasio [sic] and Andrew Cuomo have each had their part in destroying a once thriving industry. There are over 100,000 of us suffering daily now. It is the new slavery. The politicians flooded the streets with Black Cars and Taxis.”

Schifter had for years written a monthly column for the industry news site Black Car News, before stopping several months ago. Neil Weiss, the site’s owner, publisher and editor, regarded Schifter as a good friend and a “caring” and “consummate professional.”

“I was devastated . . . but I knew Doug was troubled,” said Weiss. “He was [a] very decent, caring person. He wanted what was best for the industry and what was best for all those people in it.”

Weiss said that he believed Schifter’s struggles came from the shifting tides in the industry, where a flooded market has taken business from all sectors — black cars, liveries and street-hail taxis.

“A lot of it had to do with the financial pressures and what he was seeing as a situation that had gotten to a point where he wasn’t going to be able to correct it,” Weiss said.

Fernando Mateo, spokesman for the New York State Federation for Taxi Drivers, criticized the city for what it described as overly burdensome regulations that are generally “unfriendly to small businesses.

“Cabdrivers out there are working twice as hard as they did ten years ago to make the same money that they’re making today,” said Mateo during a news conference outside City Hall, before speaking with Schifter’s family.

In a statement, TLC Commissioner Meera Joshi said: “This was a tragedy in every sense of the word. No one should ever feel so alone or overwhelmed that they would consider taking their own life. Having known him through his writings, the news of Mr. Schifter’s death was jarring for us at the TLC, and our hearts go out to his family and friends.”