On the Friday before New York City primary voters cast their ballots for mayor, Democratic candidate Christine Quinn greeted supporters on a street corner near a middle-class housing complex in Manhattan. Orange hair glistening in the sun, she stooped to hug a woman in a wheelchair and signed autographs for her fans. Trailing by 25 points in the polls, the city council speaker once viewed as Michael Bloomberg’s heir apparent was making her final appeal. “I hope people find I’m empathetic,” Quinn said. In a city struggling with inequality, that may be the central test of the race.

Democrats outnumber Republicans roughly 6 to 1 in New York City, and the winner of Tuesday’s primary will be the favorite to become the next mayor. Whether it’s Quinn; public advocate Bill de Blasio, who is leading the pack with more than 40% of the vote in the most recent public poll from Quinnipiac University; former comptroller Bill Thompson; or even former Congressman Anthony Weiner, running a distant fourth after sexting revelations torpedoed his briefly thriving candidacy, Democratic primary voters seem to be sure of one thing: they are ready for someone very different from Bloomberg.

In his 12-year tenure, Bloomberg has made New York into a prosperous global city and a magnet for new industries, smart young professionals and tourists. But instead of helping Quinn, her association with the mayor seems to have hurt her chances. Some New Yorkers have been victims of the city’s success, as rising rents and stagnant wages for the middle class have made it increasingly difficult to survive in a place teeming with the superrich. And the Democratic primary has centered on their plight.

A former Wall Street trader, media mogul and the second richest New Yorker, Bloomberg won the mayor’s race by a hair in 2001 by positioning himself as a bland technocrat with the management skills needed to bring the city to the next level. He has largely delivered on that promise, hiring a team of competent professionals who exhibited an ingenuity often lacking in city government. Bloomberg’s administration rezoned roughly 40% of New York City to make room for more luxury apartments and waterfront parks, improved air quality, started a popular bike share and banned smoking in bars and restaurants.

These improvements helped turn New York City — once thought of as mostly a financial and cultural capital— into a center for technology as well. Cornell opened a new school for engineering on Roosevelt Island, and New York City has surpassed Boston to become the second biggest recipient for venture funding for the technology sector after Silicon Valley, according to a report by the Center for an Urban Future. “Bloomberg presided over a transformation of New York from a legacy-industry town to a center of technology and innovation,” says Kathryn Wylde, the president and CEO of the Partnership for New York City, a business-development group. “He leaves it a much stronger place than he found it.”

New York City’s population, now at 8.3 million, is at a historic high, and the city will add an estimated million new people by 2040. Fifty-two million tourists visited last year. Jobs in the private sector, at 3.4 million, are up 2.5% from last year.

But there is a dark side to the city’s success. According to the mayor’s own analysis, nearly half, or 46%, of the city’s population was living within 150% of its poverty threshold in 2011. Despite the creation of roughly 165,000 affordable housing units under Bloomberg, rents have risen to an average of more than $3,000 a month. In 2002, the year after Bloomberg was first elected mayor, the average low-income New Yorker paid 43.9% of their income in rent. In 2011, that number had risen to 47.9%, according to the association for neighborhood and housing development. The year 2013 saw a record high of 50,900 homeless people in New York City, with 21,300 of them children.

Under Bloomberg’s tenure, New York City has experienced a rise in inequality that outpaces the rest of the country. The median income of the bottom fifth of New York City workers dropped $463 from 2010 to $8,844 in 2011, according to census data. During the same period, the top fifth’s income rose $1,919 to $223,285. In Manhattan, home to Wall Street and the financial crisis, the highest earners made 40 times the lowest fifth of earners in 2011, more than the 38 times in 2010, according to the New York Times.

Fairly or unfairly, New Yorkers have come to see Bloomberg as a symbol, if not the cause, of that inequality. Global economic trends far beyond the mayor’s control have played a role. But critics say Bloomberg could have done more to close loopholes in rent stabilization and preserve light-manufacturing jobs. He also might have erred in digging his heels in on stop and frisk — a policing policy that a federal judge recently ruled was tantamount to racial profiling.

Lately, Bloomberg hasn’t done much to ease the sense that he is out of touch, especially when it comes to racially sensitive topics. In late June, in response to critics of stop and frisk, he said that in New York City “we disproportionately stop whites too much and minorities too little.” And, over the weekend, New York Magazinepublished an interview in which Bloomberg said de Blasio’s campaign was “racist.”

Once considered a long shot, de Blasio has connected with voters by talking about inequality. He calls New York “a tale of two cities” and runs ads that showcase his multiracial family — a successful campaign tactic that Bloomberg felt was tantamount to racism. “Bloomberg is taking care of Wall Street, not middle-class people, working-class people, poor people,” de Blasio says to a group of voters in a diner in one TV spot.

Viewed in that light, de Blasio’s rapid rise makes a lot of sense. In July, 61% of likely Democratic voters in the New York Times/Siena College poll, said the most important quality in a mayor was someone who “understands the needs and problems” of people like them. And New Yorkers, whose mayor is so powerful and ubiquitous, have often opted for radical change when it’s time to pick a new city chieftain.

When he first ran in 2001, Bloomberg offered a stark contrast to his largely successful predecessor, the grandiose and pugnacious Rudy Giuliani. “Mayors of New York are a constant presence,” says Bloomberg biographer Joyce Purnick. “Even when they leave on a high note, there’s a sense that ‘we’ve been married to you long enough.’”