European Commission vice president Kristalina Georgieva said "every effort" was being made to avoid this scenario.
She was speaking after Tony Blair predicted a UK vote to leave the EU would lead to Scottish independence.
The UKIP leader Nigel Farage said this was a "scare tactic" that would not work.
A referendum on UK membership of the EU is due to be held by the end of 2017.
Prime Minister David Cameron could call the vote as early as June if he secures revised terms of UK membership at next month's meeting of EU leaders.
Mr Cameron is due to continue his renegotiation talks later when the president of the European Council Donald Tusk visits Downing Street.
Earlier this week, former prime minister Tony Blair told French radio that if the UK voted to leave the EU, Scotland would vote to leave the UK.
Scotland's First Minister Nicola Sturgeon has previously said the EU referendum could create the circumstances for another vote on Scottish independence.
In Brussels, Kristalina Georgieva told the BBC's Sunday Politics Scotland that the UK would lose more than it would gain by leaving the EU.
"You will have a very high opportunity cost of this decision" she said.
"I think it would be best if we concentrate to make sure that the UK - a beloved member of our family - stays in the family".
The commissioner did not want to speculate on how the EU might deal with the UK voting to leave and Scotland voting to remain.
"We make every effort for the Scottish people not to have to face a choice between Britain and the EU" she said. "So, that is not a choice that we would like to ever face."
UKIP leader Nigel Farage rejected the idea that leaving the EU would fuel demands for Scottish independence.
"I think this is another scare tactic" he said.
"You know, if we vote to leave the EU the United Kingdom will break up. We'll all be living in poverty.
"We've heard all this stuff before and I don't think it's going to work."
A top EU official has said Scotland should not have to choose between membership of the UK and the EU.