The visitors had made a bright start at Huish Park and should have scored an early opener but on-loan goalkeeper Chris Weale made a great stop from Swindon midfielder Hal Robson-Kanu.
But Terry Skiverton's side, looking for their first win in eight games, made the crucial breakthrough in the 33rd minute to breathe new life into their survival push.
A move down the right saw Paul Warne slip a neat pass to Obika and the on-loan striker lobbed advancing goalkeeper Phil Smith.
It was a tense battle from there on in with Swindon refusing to lie down in their search for a route back into the game. Their top-scorer Simon Cox thought he had netted his 25th league goal of the season only to be denied by Weale, and later Anthony McNamee provided a fine cross for the frontman but he headed wide from a good position.
Obika came close to doubling Yeovil's lead in stoppage time but Smith stood up well to block his shot.