Home prices are back to near-record highs across the U.S. amid rising demand and supply constraints, a sign that the lopsided housing-market recovery of the past five years is gaining some strength.

The S&P/Case-Shiller national home-price index, released Tuesday, has clawed its way back to within 4% of its 2006 peak, a steep rise from the near 30% decline at the bottom in 2012.

U.S. new-home sales, meanwhile, in April posted their strongest month in more than eight years, with a nearly 17% jump from a month earlier, the Commerce Department said last week.

After years of volatility, home prices have grown at a rate around 5% since early 2015. That bodes well for sellers heading into the peak home-selling season in May and June but could pose challenges for buyers, especially first-timers who may be priced out of the market as supply, particularly among starter homes, remains thin.

But the rise in prices comes amid lingering weakness in some parts of the market. Overall sales volume and new construction remain well below their pre-crisis peaks. And a broader collection of figures point to an uneven recovery that has seen a flourishing market at the high end, mainly in big U.S. cities, while the lower end lags.

“It’s a great market if you have pristine credit and lots of money,” said Sean Becketti, chief economist at Freddie Mac. “The people starting out who are looking for that first home—they’re having a tougher time.”

Despite the unbalanced recovery, Federal Reserve officials have seen housing as a bright spot for the U.S. economy in recent years. Residential construction has contributed to overall economic output for eight straight quarters, expanding at a 17% annual rate in a first quarter marked by slow growth in other sectors.

Yet while sales are increasing, they have nonetheless been stymied by a lack of new inventory and first-time home buyers. Sales of existing homes, which account for the bulk of the overall market, clocked in at a 5.45 million seasonally adjusted annual rate in April, the second consecutive monthly increase but below the peak seen during the last decade’s boom.

The S&P/Case-Shiller national index rose 5.2% in March. But that is mainly because of a lack of inventory, economists said. When adjusted for inflation the S&P/Case-Shiller index remains about 20% below its peak reached in 2006.

Building activity, meanwhile, remains muted compared with normal markets. April’s single-family housing starts were at a seasonally adjusted annual rate of 778,000 units, down from a more than five-decade average of about 1.03 million, according to Census data.

Still, several markets have surpassed their 2006 price peak, prompting concerns about a bubble.

In Dallas, where prices have returned to record levels, first-time buyers have struggled to get into the market. Shriveling inventories of starter homes have driven up prices and led to bidding wars, while wealthier buyers enjoy a better selection of luxury properties to choose from.

That has made it difficult for buyers like Jeremy Ponce and his wife, Lyndel, who started looking to purchase a home in Dallas last spring after living in a rental apartment.

They were hoping to find a smaller starter home in the urban center, but quickly realized how competitive the market had become. With inventories at nearly three-decade lows in Dallas, most of the homes in their price range required too many repairs.

“The price they wanted just didn’t seem realistic,” said the 31-year-old Mr. Ponce, who works as a project manager for a company that builds rail cars. “Some of them were only a little bit bigger than our apartment.”

The couple widened their search away from downtown, but it still took about six months to find what they were looking for: a 3-bedroom, 3½-bath home that was about a five-minute drive from popular entertainment districts. They put in an offer of $417,000, above the asking price of $399,000. Yet Mr. Ponce said they considered themselves lucky.

Homeownership has been declining since the peak of the housing bubble. The national rate slipped in the first quarter to a near four-decade low of 63.5%, according to the Commerce Department. The homeownership rate for households headed by someone under 35 years old fell to 34% in the first quarter of this year, the lowest level since at least 1994.

One main culprit: stricter lending standards since the financial crisis, which have made it tougher for lower earners to qualify for mortgages.

That, in turn, has prompted builders to focus their efforts on the higher-end segment of the market. New homes under $200,000 made up 19% of U.S. sales last year, down from 38% four years earlier, according to U.S. Census data.

An influx of high-earning workers to big U.S. cities is magnifying the imbalances by driving up rents and setting off a scramble among developers to build luxury condominiums and apartment buildings.

The S&P/Case-Shiller index covering the 20 largest U.S. cities rose 5.4% in the 12 months ended in March, outpacing the overall market.

In the hottest regions in the country, primarily on the West Coast, prices rose at a double-digit pace in March, with Portland, Ore., reporting a 12.3% year-over-year gain, Seattle showing a 10.8% gain and Denver logging a 10% increase.

Portland has been one of the nation’s most robust real estate markets over the last few years as its growing technology sector attracts workers. That has created strong demand for available parcels of land, driving up the individual lot prices—and thus the asking price for a new home.

Jim Chapman, president of Legend Homes, said lenders often are only willing to finance surefire projects at the higher end of the price spectrum.

“Even if you have a lender who will loan you money to operate with, you have to show that that project is actually going to make a profit,” Mr. Chapman said.

Mr. Chapman said he is spending between $250,000 and $350,000 just to acquire and develop the land, before even starting to build the home.

“You can’t build a house that’s going to sell for $299,000 to an entry-level market if you spent more than that for the land,” he said.