Marin, Santa Cruz and San Francisco counties are among the five least affordable markets in the nation. That’s according to a first-quarter analysis of 456 U.S. counties by RealtyTrac, the real estate information company.

In Marin County, the average wage earner would need to spend 109.2 percent of monthly wages to make monthly mortgage payments — including insurance and property taxes — on a median-priced single family home or condo. The median price there is $875,000.

In Santa Cruz, where a median home costs $642,000, 106.9 percent of wages would be required to keep up with the mortgage. In San Francisco, where a median home sells for $1,102,550, a mere 95.3 percent of an earner’s monthly wages would cover the mortgage.

RealtyTrac puts Brooklyn, N.Y., at the top of the list of the nation’s least affordable markets: 120.4 percent is required to keep up with a mortgage in that New York City borough. In Manhattan, 105.1 percent is needed.

What is going on?

“Ultimately, it’s the disconnect between wage growth and home price growth,” said Daren Blomquist, RealtyTrac’s senior vice president. The company’s analysis is based on the cost of 30-year fixed mortgages, with 3 percent down. (The Federal Housing Administration insures loans with small down payments, though banks often require 10 or 20 percent down.)

Of course, this is just one way of depicting the affordability crisis. As a practical matter, two or three wage earners will often combine their money to cover the cost of a mortgage. Most banks or financial advisers would insist on seeing no more than 40 percent of income going toward housing costs before they extended a mortgage.

Marin County’s ascent toward non-affordability has been helped along by the many wealthy foreign investors in San Francisco real estate, Blomquist noted. Local buyers who might otherwise have bought in the city are pushed out into the suburbs and across bridges, heating up prices there.

Relatively speaking, Silicon Valley is a bargain, according to the analysis.

In Santa Clara County, 57 percent of monthly wages will cover the mortgage on a median-priced home, which costs $805,000. One reason is that wages are higher there: In the third quarter of 2015, the average weekly wage was $2,090, according to the U.S. Bureau of Labor Statistics. That compares with $1,712 in San Francisco and $1,185 in Marin.

Yet even in Santa Clara County, “the upward pressure on wages,” Blomquist said, hasn’t kept pace with the upward pressure on housing prices. Since the first quarter of 2012, when a median-priced house cost $450,000, home prices have risen 79 percent, while wages have gone up 8 percent. It isn’t hard to imagine that some locals are fleeing to Santa Cruz County, pushing up prices there.

In Alameda County, where the median home costs $600,500, 68.9 percent of monthly wages are needed to cover the mortgage. The average weekly wage in Alameda County was $1,289 in the third quarter of 2015.

“While the vast majority of housing markets are still affordable by their own historic standards,” Blomquist commented, “home prices are floating out of reach for average wage earners in a growing number of U.S. housing markets.”

He noted that the recent drop in interest rates “has helped to soften the blow of high-flying price appreciation in some markets, but the affordability equation could change quickly if interest rates trend higher and home prices continue to rise faster than wages.”

Contact Richard Scheinin at 408-920-5069, read his stories at www.mercurynews.com/richard-scheinin and follow him at www.twitter.com/RealEstateRag