New York City— These days, building cranes are casting shadows over Harlem, the Far West Side, and the waterfront in Brooklyn— once-neglected neighborhoods that haven’t seen market-rate residential construction on any scale since before World War II.

Multifamily developers took out more building permits in 2005 and 2006 than in any two-year period since 1965, according to city officials. The fancy new high-rise and mid-rise buildings they’re constructing are bringing wealthy residents and rising housing prices to many parts of the city, said Nancy Pakes, president of Halstead Leasing Co. in New York.

But so far the flood of new housing has not created much competition with existing rental apartments. Almost all of the new developments are for-sale condominiums.

The high demand for housing and the small amount of new rental development are just two of the reasons New York City ranked third in our analysis of the top apartment markets.

New apartment construction is still sluggish despite a heroic effort by Mayor Michael Bloomberg to encourage new housing development, including opening up large areas such as the Far West Side and the Brooklyn waterfront to dense development. The city also simplified its famously obscure building code, and attracted national real estate investment trusts like AvalonBay, Archstone Smith, and Post Properties, which are all developing apartments here.

But the high cost of land and construction still keeps many developers from building rental apartments. The rental inventory has grown by an average of just 1.1 percent a year since 2000.

City officials predict New York’s population will reach 9 million by 2025. Where will all those new residents fit? The city is already one of the most densely populated places on earth. The imbalance between the supply of rental housing and the demand has pushed the percentage of vacant apartments down to 2.4 percent.

The competition for apartments is intense, and gentrification adds to the tension. Even with the average income here growing about 5 percent a year over the last five years, New York is still one of the least affordable housing markets in the top 50. It doesn’t help that Wall Street employees with seven-figure incomes can pay even more than landlords are asking for top-tier apartments.

Two-thirds of New York’s more than 8 million residents are renters, making the city the nation’s largest apartment market. With pent-up demand high, that means that despite the flood of new condominiums, it will likely be a long time before apartment owners here have to worry about overbuilding.