Scott Parker's side appeared set for frustration as they struggled to break down a Birmingham side now without a win in nine Sky Bet Championship matches.
But Onomah – on as a 60th-minute substitute – swept home from 12 yards to deliver the victory that moves them to within four points of second-placed West Brom.
Prior to that moment, the Cottagers had struggled to break Birmingham down with in-demand Blues teenager Jude Bellingham coming closest to breaking the deadlock.
The 17-year-old is a target for Manchester United but is believed to be close to sealing a move to Borussia Dortmund with the Bundesliga side reported to have offered a deal worth up to £30million.
And the youngster came close to scoring his fifth league goal of the season when an early header crashed against the Fulham crossbar.
Parker's side survived that scare but did not look capable of taking full advantage until they injected more tempo into the game after a disappointing first half.
Even then, when they did manage to find a way through the Birmingham defence, visiting keeper Lee Camp produced a succession of fine saves before he was finally beaten by Onomah.
The Cottagers had struggled to find their feet after the restart, suffering back-to-back defeats before the midweek win at QPR.
And it looked as though they would rue the continuing absence of striker Aleksandar Mitrovic, who was serving the second game of a three-match ban.
In the absence of the leading scorer, Bobby Decordova-Reid led the Cottagers' attack but was unable to provide the same cutting edge.
There was a greater sense of urgency in Fulham's approach after the break as they dominated long periods of possession.
Camp again denied Knockaert before producing a superb double save from Joe Bryan and Decordova-Reid, but the keeper was powerless to prevent Onomah claiming the points after being set up by Harrison Reed.