By Tommy Stubbington 

Greece's future in the eurozone is on a knife edge, and so are investors.

If Greek voters reject austerity demands from the country's creditors in Sunday's referendum, many investors expect stock markets in Europe to plummet. A "yes" vote would likely spark a rally, they say.

But with opinion polls indicating the vote may be close, many are opting to ride out the storm and stick with their holdings of European stocks, betting that even an eventual Greek exit from the eurozone won't derail a broader economic recovery in the region.

"The problem is it is such a binary event. If you are caught on the wrong foot you could suffer," said François Savary, who oversees $11.4 billion as chief strategist at Swiss bank Reyl.

Few expect Sunday's vote to provide any kind of lasting resolution to Greece's long-running negotiations with creditors. But most investors agree a "no" vote would mark an intensification of the crisis--significantly raising the chance of Greece leaving the eurozone. Monday's market reaction would be ugly, investors say.

European stocks and bonds of highly indebted countries seen as vulnerable to shocks from Greece, such as Italy, Spain and Portugal, have already weakened as the Greek talks deteriorated over the last month. If markets wake up to a "no" vote on Monday, the selling could accelerate.

Mr. Savary thinks stocks in Europe would fall by around 5%. If Greece votes to accept the austerity measures proposed by lenders, he expects a smaller relief rally.

He remains positive on European equities for the longer term, and is holding his positions heading into the referendum.

Despite the short-term risks, investors are reluctant to cut back their exposure to European stock markets, which have surged this year, fueled by the European Central Bank's stimulus program and an upturn in the economy.

The Stoxx Europe 600 index remains more than 12% higher in 2015, having fallen nearly 3% in the last month.

"We are using every setback as a buying opportunity," said Andreas Koester, head of asset allocation and currency at UBS Global Asset Management, which oversees $680 billion. Mr. Koester also expects the market to fall around 5% on a "no" vote, but expects it to stabilize quickly as bargain hunters step in.

"A lot of people are looking for an opportunity to get into this market, " he said.

Investors are also counting on the ECB to limit the fallout.

If Greece looks headed for departure from the euro area, investors will start to worry that Italy or Spain could one day follow, according to Luca Paolini, chief strategist at Pictet Asset Management, which has EUR149 billion ($165.3 billion) in assets under management. But the ECB is likely to counter a heavy selloff in these countries' bonds, possibly by scaling up its asset-purchase program, he said.

"The ECB's pledge to do whatever it takes to safeguard the euro is credible," Mr. Paolini said, adding that Pictet has been buying Italian and Spanish bonds as prices fell in recent weeks.

The ECB has further tools at its disposal.

Under a program called Outright Monetary Transactions, the ECB can purchase government bonds of vulnerable countries provided they first sign up for an aid program. The program hasn't been used, but Europe's top court recently affirmed its legality, underscoring that it is available.

Any relief from a "yes" vote could prove short-lived. European officials have indicated negotiations could still be long and painful if Greeks vote to accept creditors' measures.

"There will still be a lot of question marks on Monday morning even if we get a resounding 'yes,'" said Stephanie Flanders, chief European market strategist at J.P. Morgan Asset Management, which manages $1.7 trillion of assets.

Write to Tommy Stubbington at tommy.stubbington@wsj.com