You can't just hop behind the wheel of a yellow car and call yourself a New York City cab driver.

Every taxi must have a New York City-issued license, known as a taxi medallion, which is literally attached to the hood of the car.

The catch: They cost hundreds of thousands of dollars.

Medallion prices have skyrocketed in recent years, up 50% between 2009 and 2014, to a high of more than $1 million each.

Some drivers own their medallions, but often medallions are owned by companies that operate fleets of taxis.

But now the value of these medallions is taking a huge hit as Uber cars flood the city. The most recent sale price was just $740,000, down nearly 40% from last year.

There are 13,600 yellow taxis in New York City. But the competition from 20,600 Uber cars that can be easily summoned with an app has cut sharply into the taxis' customer base.

On top of that, many taxi drivers are opting instead to work for Uber, and that leaves some taxis bearing an expensive medallion sitting idle without bringing in any revenue.

One result of the changing taxi industry economics is the current battle between Uber and City Hall. New York Mayor Bill de Blasio is pushing for an effective one-year moratorium on new Uber cars. Uber has responded with a high-profile public relations campaign accusing de Blasio of being in the pocket of the taxi industry.

Related: Uber use surges among business travelers

The plunge in medallion values has created a financial crisis for taxi owners.

Many owners take out loans to buy the medallions, much as a home buyer would finance a mortgage. But these loans are only for several years, so owners have to keep taking out new loans. That was easy enough to do when the value of the medallions kept going up.

But lenders big and small -- from Citigroup (C) to credit unions -- are refusing to refinance loans for medallion owners. And at least one lender, New York Community Bank, is looking to get out of the medallion lending business entirely.

If taxi owners can't refinance their short-term loans, the lenders can seize the medallions that were put up as collateral. That will force many out of business, and the foreclosure sales of their medallions will drive down prices further.

Citigroup is seeking to seize 89 medallions owned by Evgeny "Gene" Freidman, the largest medallion owner in the city, arguing their values have declined. Freidman, who was also a major campaign contributor to de Blasio during his successful 2013 mayoral campaign, is fighting Citi's move in court.

"New York must stand up to the hostile takeover being attempted by a Mafia-like Silicon Valley, in conjunction with predator banks," Freidman said in a statement. "If banks bail on this industry ... one may see crisis amongst taxi owners and operators nationwide."

Related: Uber may now be worth $50 billion. Really?

Uber isn't the only thing driving down medallion prices, says Andrew Murstein, president of Medallion Financial (TAXI), a lender that once specialized in such loans. He said too many lenders were making too many medallion-backed loans, creating an asset bubble. Now that some lenders are pulling out, prices are normalizing.

Murstein said that medallion prices have fallen a lot more than a taxi's average revenue, which is only down about 5%.

"The medallion prices have come down," he said, "but to be honest, they were too high in the first place."