But it was Glasgow who dominated the second half in terms of possession and territory and they gradually fought back to lead by one on 63 minutes.
Ruaridh Jackson's boot had got them back in front with three well-struck penalties, yet Connacht did not wilt and one final surge forward with six minutes to go paved the way for the winning penalty from Keatley.
In the first half, it was Glasgow who took charge early on. They led 8-0 midway through the first half, with Jackson kicking them in front in the third minute and a try from Graeme Morrison, after a concerted spell of pressure, stretching their advantage.
It was a well-taken score with Morrison's centre partner Max Evans making a break down the left, and good hands from fly-half Jackson as the ball was moved right.
The Warriors' back row had the edge at this point with returning captain John Barclay to the fore and although Jackson missed the conversion, the signs pointed to a comfortable evening for the hosts.
Connacht's route back into the contest came through their impressive scrum. Led by the hugely effective pairing of Brett Wilkinson and the excellent Jamie Hagan, the visitors were garnering turnovers and penalties off the set piece.
Keatley kicked two penalties on 24 and 29 minutes to narrow the gap to 8-6 and raised hopes for the visitors, but the half's most pivotal moment came on 37 minutes with Fionn Carr's fourth try in two games.
It started with a turnover forced by Sean Cronin and Mike McCarthy which led to a Connacht scrum. From that, they attacked the open side and winger Carr came in off the line, danced past a flurry of tackles, straightened and sprinted home under the posts for an inspiring score.
That left it 13-8 at half-time, and while Keatley added to that lead, two quick penalties from Jackson brought the home side within two before the final quarter. His third successful kick edged them ahead.
Beaten in injury-time by the Scarlets last weekend, Connacht showed great mettle to carve out the match-winning score.
It came from a lineout in the 22 and a brilliantly set-up maul. Glasgow were driven back and forced to collapse, and the penalty was a formality for the in-form Keatley.
Yet from the restart a knock on gave Glasgow prime attacking territory. They had the overlap but Evans failed to shift the ball wide and with the last kick of the game Duncan Weir lined up a 30-metre drop goal. His effort drifted to the left and wide, much to the frustration of the home support.
The result represented Connacht's first away win in the Magners League since they beat the Newport Gwent Dragons at Rodney Parade in April 2008. It was also the Irish province's first success on Scottish soil since September 2006.
|Glasgow Warriors Score Card|
|Connacht Rugby Score Card|