The Borders kicker Gareth Morton failed to hit the target with three penalty goal attempts in the closing stages, resulting in a 26-25 reverse.
Relief for the home side but desperation for the visitors who remain rooted to the bottom of the table.
Home coach Hugh Campbell said: ‘I was happy to hear the final whistle. We gave away far too many penalties.’
The first half opened with a batch of penalties as both sides stuggled to settle into the rhythm of the match.
Borders took the lead with a successful effort from Morton in the second minute. Glasgow responded and Dan Parks put over a long strike.
Three minutes later referee Adams spotted an offence right on the halfway line and Morton struck it home – fans will be wondering where Morton’s range wasa in the final moments.
Glasgow had been the more cohesive and scored the night’s opening try in 14 minutes. Andy Wilson made ground on the right before the ball was spun across field for Sean Lamont’s try which Parks converted.
Five minutes later home scrum-half Kenny Sinclair watched as Tony Walker grabbed the ball at a line-out and, when Glasgow offended at the subsequent ruck, Morton edged Borders into a 10-9 lead.
Things got worse for Glasgow when Lamont was sin-binned and Borders’ game came together.
Parks had a clearing kick charged down and from the resulting line-out Morton came into the line to touch down under the bar and convert.
However, Glasgow had pulled the score back to 16-16 by the interval thanks to two more Parks penalties, with Walker sin-binned at the second.
Borders began the second half brightly but could only claim a Clark Laidlaw drop goal before Glasgow scored their second try.
The Borders scrum was twisted close to their line and Roly Reid picked up and drove over for Parks to convert.
Morton and Parks then exchanged kicks before the scoring from kicking ceased and the away side left with just a bonus point.