The future of the British territory is a major outstanding problem for Mrs May, with Spanish Prime Minister Pedro Sanchez threatening to vote against the Brexit agreement over the row.
Spain is demanding that the future of the Rock is settled through direct talks between London and Madrid.
But diplomats in Brussels have accused Mr Sanchez of trying to score points with voters ahead of a regional election in Andalusia – which shares a border with Gibraltar – on December 2.
One leading diplomat told Politico: “It seems Sanchez has his eyes on the elections in Andalusia.”
The vote will be socialist Mr Sanchez’s first test under his leadership and a strong international battle will likely boost his popularity in the vote.
It comes after Mr Sanchez vowed to vote against the Prime Minister’s Brexit agreement unless the bitter dispute is resolved.
The Spanish Prime Minister said that his government was “annoyed” that the divorce deal did not state that Gibraltar’s future would be decided between Spain and London.
Mr Sanchez added: “If this is not solved by Sunday, Spain, a pro-European government, will unfortunately have to vote ‘No’.”
Fellow EU nations are furious with Mr Sanchez’s stance with Ireland’s foreign minister Simon Coveney saying: “If you reopen [the Withdrawal Agreement] for one issue, well then there is an avalanche of other asks, I am sure, that different countries will have.”
And an EU diplomat added: “We are following the latest developments with growing concern and incomprehension.”
But last night Mrs May insisted that there had been “good engagement” between the UK, Spain and Gibraltar.
A Downing Street spokesman said: “She said there had been good engagement between the UK, the government of Spain and the government of Gibraltar in order to come to an agreement in the withdrawal agreement and associated package of memoranda of understanding relating to Gibraltar.
“She said that the UK and government of Gibraltar looked forward to these discussions continuing as we discuss the future relationship.
“The Prime Minister reiterated her commitment to agreeing a deal that works for the whole UK family including Gibraltar, the other UK overseas territories and the crown dependencies.”
The issue of Gibraltar is believed to be the final obstacle from EU leaders that Mrs May faces.
Previous concerns over fishing and trade have been addressed, according to an EU diplomat.
The source said: “The only thing really outstanding is Gibraltar.”
Mrs May is returning to Brussels on Saturday for crunch talks with European Commission President Jean-Claude Juncker ahead of the leaders’ summit.
Gibraltar has been a British territory since 1713 but Spain has long claimed sovereignty.
In the 2016 EU referendum 96 percent of Gibraltar’s population voted to remain in the EU.