Squeezed between cut-throat competition from online financing firms and rising funding costs, China's midsize banks are falling out of investors' favour as they increasingly lag behind the country's top five lenders.

While margins generated from lending have remained broadly stable at the larger banks, they have shrunk considerably for the second-tier lenders like China Everbright Bank (>> China Everbright Bank Co., Ltd) and China Merchants Bank (>> China Merchants Bank Co., Ltd) over the past six months, a Reuters data analysis shows.

And like some of their European peers, those smaller lenders are also lagging behind the big banks in terms of balance sheet strength, analysts say, a factor that is likely to be highlighted in the banking sector's third-quarter earnings.

China's five biggest banks are Industrial and Commercial Bank of China Ltd (>> Industrial and Coml Bank of China Ltd)<1398.HK> (ICBC), China Construction Bank Corp (>> China Construction Bank Corporation)<0939.HK> (CCB), Agricultural Bank of China Ltd <1288.HK> (>> Agricultural Bank of China Ltd), Bank of China (BoC) (>> Bank of China Limited)<3988.HK> and Bank of Communications Co Ltd (>> Bank of Communications Co Ltd)<3328.HK> .

"The divergence between big and medium or small-sized banks will increase, as the latter see higher fundraising risks due to their weaker capital base," said Fan Cheuk Wan, chief investment officer Asia Pacific in Credit Suisse's private banking and wealth management unit.

CCB is due to kick off the banking sector's third-quarter earnings season on Thursday.

Second-tier lenders, also known as joint stock banks, have, on average, a market capitalisation of less than 300 billion yuan (30.56 billion pounds), significantly smaller than the big five lenders.

Chinese banks' net interest margins (NIMs), or the gap between what the lenders pay out for deposits and rake in from loans, have come under pressure from aggressive competition from online financing firms such as e-commerce group Alibaba's (>> Alibaba Group Holding Ltd) Yuebao platform.

This is particularly a problem for smaller banks, which have to pay more to fund themselves as their regulatory capital ratio - a measure of balance sheet strength - is on average 1.5 percentage points weaker than that seen at the larger players.

"Net interest margins are likely to decline faster for smaller banks in China going forward, as they face rising costs of funding," said Vincent Chan, head of China research at Credit Suisse.

The average net interest margin for China's top five banks, has remained stable at around 2.6 percent over the last year.

In contrast, the next seven banks saw this key indicator of profitability drop to 1.86 percent in the second quarter from levels previously comparable to the big banks. The margins are seen falling further in the third-quarter.

To counter the profit squeeze, investors say second-tier lenders may look to innovate by embracing online finance.

"Online e-commerce is one area where the small- and mid-sized banks are a lot more flexible in partnering with a lot of the e-commerce retailers," said Tony Chu, who manages a portfolio for RS Investments, a fund with $22.3 billion (13.89 billion pounds) of capital and positions in Chinese banks.

The big five banks also benefit from closer ties to the country's top state-owned companies, known as SOEs. Lending to these conglomerates is considered much safer because of implicit government guarantees.

"Large SOEs will emerge as winners and you want to be the bank that's lending to them, not the guys that are going to be driven out," said Matthew Smith, a banks analyst at Macquarie. Smith said he was positive about ICBC and CCB versus the smaller lenders since they count more large public companies among their clients.

(Editing by Lisa Jucca and Miral Fahmy)

By Engen Tham and Lawrence White