Obika showed strength and composure to net following Ross Wallace's brilliant long pass to give St Mirren a deserved 1-0 win in Paisley.
The result sent St Mirren six points clear of Hearts into ninth spot while Daniel Stendel's side fell four points adrift with games against Livingston, Ross County and Aberdeen to come before the split.
St Mirren had asked fans with cold or flu like symptoms not to attend and briefed stewards not to admit those exhibiting the potential signs of coronavirus but there was a crowd of 5,662 inside the Simple Digital Arena.
St Mirren looked sharper, more positive and determined than their opponents from the start and created a number of chances from balls into the box.
Akin Famewo did not get enough connection on a shot, Sam Foley got too much on one which flew over, and Obika could not get any at all on Wallace's inviting free-kick.
The home side lost Conor McCarthy to injury around the half-hour mark, forcing midfielder Foley back into central defence as Jamie McGrath came on.
The moment of the half came following a penetrating move from the hosts. Two swift passes sent Alex Jakubiak down the right and his low cross was met first time with power by Cammy MacPherson. However, Zdenek Zlamal produced a brilliant reaction save to divert the shot over the bar. Ilkay Durmus soon went close for Saints.
Hearts' only first-half shot on target was a weak long-range effort from Aaron Hickey and they were booed off at half-time by many in the sold-out away stand.
For the second game running, striker Liam Boyce replaced midfielder Sean Clare at the interval for Hearts and the visitors actually started the second period on the front foot.
But they were caught out when Wallace picked up a loose pass and sent the ball over the top. Obika ran on to it, took a touch, held off the Hearts centre-backs and stabbed the ball home.
Saints soon came close to a second when Zlamal touched Jakubiak's shot wide after McGrath set up the attacker.
The home side also lost MacPherson and Durmus to injury and they fell away as as attacking force.
There were more boos from the Hearts fans as Daniel Stendel replaced Oliver Bozanic with Andy Irving but cheers when he took off Loic Damour for Ryotaro Meshino. The jeers returned as the midfielder ran off.
Hearts pushed St Mirren back for much of the final 20 minutes. Lewis Moore passed up a good chance when he could not control a rebound following Conor Washington's blocked shot.
The visitors appealed strongly for a penalty when Clevid Dikamona claimed he had been held by Foley and the home side's defending got increasingly desperate in six minutes of added time but Vaclav Hladky finished the game without making a difficult save.