James Bracey top-scored with 79 and Ryan Higgins hit 50 as the home side recovered from 167 for five to post 317 all out, before the County, with former captain Ricardo Vasconcelos left out of the team, closed the day on 30 without loss in reply.
Keogh was the most successful Northants bowler as he claimed three for 61, while there were two wickets apiece for Ben Sanderson, Jack White and James Sales, the man brought into the side in place of Vasconcelos, who has been struggling for form all season.
The match is very much a must-win for bottom-of-the-table Gloucestershire, who have yet to claim a victory in red ball cricket this summer, while seventh-placed Northants know a win for them will see them pull even further away from the bottom two.
The gane is evenly poised going into day two, and Keogh was pleased with how things turned out for the County.
"There was a bit in the wicket for all the bowlers, something for the seamers and a bit of turn," said Keogh.
"But it is a fast scoring ground and anything a bit off line or length gets punished.
"We were probably a bit guilty in that respect and at tea, with Bracey going well and a partnership building, we got together and made it clear we had to break it quickly.
"That's what happened.
"Our openers did well in the final session because there was nothing much to gain and a lot to lose.
"Overall, we have to be happy with the day and the position we are in."
Openers Will Young (19no) and Gay (8no) will resume their partnership at Cheltenham College at 11am on Tuesday.