Second half goals from Elliott Ward - a penalty - and Mitchell Cole completed an impressive comeback from Tony Carr's team after a disappointing first half performance that had seen them go in at half-time a goal down.
The win takes Hammers' lead at the top of group C to five points clear of second placed Fulham with just three games to play. One more victory and a draw would be enough to see them through to a play-off quarter-final away at Arsenal or Aston Villa, who are neck and neck at the top of group D.
However, it didn't look like working out that comfortably for Hammers early on against Coventry, as they started poorly and gifted the hosts a goal in the first 10 minutes, when Elliott Ward misjudged a long clearance and saw his attempted back-header to Glenn Jackson fall short, allowing a Coventry striker to nip in and convert.
Ayo Akinsete and Greg Pearson went close to equalising before the break, but Hammers showed no real signs of turning the game around and Coventry ended the half the stronger side again.
The second half was a complete reversal of fortunes, though, as the visitors came out with a new sense of drive and determination and set the pattern of the game immediately.
The equaliser arrived on 55 minutes, when a corner wasn't cleared properly and the return ball into the box was handled by a Coventry defender as he jumped to head clear. The referee spotted the infringement and Ward stepped up to convert from 12 yards out and make up for his earlier error.
Hammers controlled the rest of the game without creating any real glorious chances, but the breakthrough arrived with 10 minutes left, when Ward collected the ball in his own half and strode forward before angling a searching pass from right to left over the top of the Coventry defence.
Cole read the situation fastest and raced clear on goal before blasting into the net for a deserved winner.
Team: Jackson, McClenahan, Tattam, Ward, Blewitt, Lumsden, Wright, Bunce, Akinsete, Pearson, Cole. Subs unused: Sealey, Fletcher, Lee, Collington, Parrington.