How do you beat a man who can overwhelmingly outspend you with his own money and has the backing of a politician as universally admired as Franklin Delano Roosevelt was in his day? How do you overcome ethnic and racial tensions, a reputation for being less than lovable, the advantage that the tragedy of Sept. 11 gave to a first-time candidate claiming his business background as his strength?

As Mark Green learned yesterday, you don't.

The lifelong Democrat's mayoral hopes ended sourly yesterday with his narrow defeat to Michael R. Bloomberg, the wealthy businessman. The outcome now seems to have been inevitable, Mr. Green's sizable lead in polls evanescent, shrunk by the Bloomberg spending, Mr. Giuliani's blessing, the impact of a terrorist attack on the city's political psyche, and Democratic Party dissension.

Now there is no longer a question. Money can clearly win elections if the circumstances are right. Mr. Bloomberg will have spent what may reach $60 million of his own money, on what Mr. Green called "an avalanche" of promotion.

So much for campaign finance reform. And maybe, so much for Democrats as we know (or knew) them in New York City, where Democrats outnumber Republicans five to one. But definitions are changing.

Some of Mr. Green's narrow failure reflects his own inability to define himself with voters, and his tendency to irritate many party faithful who should have been in his corner. Arrogant, he was called, by more than a few public figures intimately familiar with that quality.

But Mr. Green's defeat, it seems fair to say, reflects more than any character flaws or even lavish spending by his opponent. This election suggests that New York Democrats are now predominantly Giuliani Democrats: people who consider themselves to be progressive Democrats but are willing to cross party lines, maybe because they hope for another Giuliani, or because they associate loyal Democrats like Mr. Green with a past they do not admire.

People like Harriet and Kenneth Wald. Last June, on the day Mr. Bloomberg made his debut as a candidate and visited a restaurant near Arthur Avenue in the Bronx, he met the Walds, who were dining there with their son, Joshua. The Walds, both psychoanalysts, said at the time that they were longtime registered Democrats who live on the Upper West Side and, until the Giuliani candidacy, never dreamed of voting for a Republican.

But they were Giuliani supporters and might consider voting for Mr. Bloomberg, they said then. They did. Reached Monday, they spoke disparagingly of Mr. Green, admiringly of Mr. Bloomberg. "The Democrats didn't really offer us very much," said Mr. Wald. "Bloomberg, as far as I'm concerned, didn't cause the problems that Green failed to fix in all his years of public service, like education, housing, health." Not, he said, that as public advocate Mr. Green had much power. "But he is part of the political machinery that damaged this city, and I say that as a regular Democrat," he said. "Green is too much a part of the old past. He says the same old things."

Harriet Wald said she thought Mr. Bloomberg had a lot to learn: "He is used to being a C.E.O. of a company, which is different from being a politician. But I do think in order to rebuild the city, it's necessary, because of Sept. 11." The Bloomberg spending did not bother her, she said — "What should he do, not use it?" — nor did the Giuliani endorsement influence either of them; both had decided on Mr. Bloomberg earlier.

But others clearly were moved by Mr. Giuliani. A survey of voters showed that about half of the Bloomberg voters said the mayor's endorsement of Mr. Bloomberg influenced their vote, and Mr. Bloomberg drew healthy support from white ethnic voters — Mr. Giuliani's base.

The Democratic infighting no doubt hurt Mr. Green with black and Latino voters. He did not do as well with them as a classic Democrat usually does — in part because of the animosity of the Rev. Al Sharpton and Fernando Ferrer. They were furious over harsh tactics that Mr. Green insisted were not his doing. He refused to appease Mr. Sharpton by firing campaign aides and they never made peace.

Lavish spending, a changing electorate, the racial and ethnic dissension that sticks to Democrats like glue, the Giuliani juggernaut, a candidate who never captured the public's imagination. End result: defeat.

Once, the very idea that New York City would elect two Republican mayors back- to-back seemed preposterous. But maybe that was a different New York City.