The anxious executive cornered Bill de Blasio in an elevator, with an urgent plea.

New York City was planning to allow thousands of new taxis to operate outside Manhattan, directly threatening his car and limousine business. Would Mr. de Blasio, the city’s public advocate, help block it?

It was hard to imagine Mr. de Blasio, a Brooklynite who built his reputation on standing up for the boroughs beyond Manhattan, opposing a proposal to improve transportation for his chronically taxi-starved neighbors.

But soon after the elevator encounter that day in 2011, the car service executive, Avik Kabessa, heard back from the public advocate’s office.

The message, Mr. Kabessa recalled, was clear: “Bill is looking to help.”

Mr. de Blasio would emerge as the taxi plan’s most prominent opponent, leading sidewalk rallies and using his office to fight it in court — and confounding allies who found his stance incongruous with his typical stands.