July 14 (Reuters) - JPMorgan Chase and Wells Fargo said on Friday they set aside more money for expected losses from commercial real estate loans, in the latest sign that stress is building up in the sector.

Lenders' exposure to commercial real estate has come under growing scrutiny this year, as the sector globally - particularly office buildings - has been pressured by high interest rates and workers continuing to stay at home.

Wells Fargo reported higher losses in CRE due to its office loan portfolio. It increased its allowance for credit losses by $949 million.

But the bank also said its CRE revenue increased quarter-over-quarter to $1.33 billion, primarily due to higher interest rates and loan balances.

"While we haven't seen significant losses in our office portfolio to-date, we are reserving for the weakness that we expect to play out in the market over time," Wells Fargo CEO Charlie Scharf said.

JPMorgan's CRE revenue grew to $806 million in the second quarter from $642 million in the first quarter. The bank, which acquired First Republic Bank in May, reported $1.1 billion in credit loss provisions driven by its office portfolio.

While the bank's office portfolio was "quite small," JPMorgan CFO Jeremy Barnum told investors that "based on everything we saw this quarter, it felt reasonable to build a little bit there to get to what felt like a comfortable coverage ratio."

The U.S. Federal Reserve's annual stress tests last month painted a better-than-expected picture of big banks' CRE exposure, with projected losses in the event of a market crash declining slightly on last year.

The majority of office and downtown CRE loans, however, are held by smaller regional and community banks, which are not subject to the same strict capital buffers, the central bank said.

Regulators have been keeping a close eye on CRE risk, particularly at banks with the highest ratio of such loans to their total capital, while lenders have been working with customers to try to prevent defaults.

CRE borrowers have struggled with higher refinancing costs as property values declined and interest payments have risen. Some $20 billion of office commercial mortgage-backed securities, which bundle together individual loans, mature in 2023, according to real estate data provider Trepp.

The McKinsey Global Institute forecast office property values could decline by $800 billion across nine major U.S. cities over the next seven years, according to a report. Based on a "moderate" scenario, McKinsey predicted demand for office space in 2030 would be 13% lower than in 2019.

(Reporting by Matt Tracy; editing by Michelle Price, Lananh Nguyen and Nick Zieminski)