Gerald Sibon headed Sheffield Wednesday in front in this delayed third round meeting after only four minutes. He rose perfectly to meet Alan Quinn's left-wing corner and the goal stood, despite Andy Hessenthaler's attempt to hack the ball off the line.
Gillingham were playing their first game for 12 days, following three successive postponements with this game only going ahead after a morning pitch inspection by match referee Paul Taylor.
Gillingham bounced back from conceding the early Sibon goal and were level on 12 minutes with King's first. Nayron Nosworthy's free-kick was flicked on to King and as Wednesday's deputy keeper Chris Stringer came off his line King knocked the ball past him into the net.
Five minutes later he was celebrating his second after defender Ashley Westwood was penalised for handball in the area. King stepped up to send Stringer the wrong way from the spot.
Fellow strike partner Ipoua was a constant menace with his mazy runs but he wasted a great chance to score Gillingham's third when he got past three Wednesday defenders only to shoot over the bar.
However King provided him with a simple chance four minutes before the break. He burst down the right and fired in a low shot that bounced off the unlucky Stringer and straight into the path of his strike partner, who couldn't miss from four yards.
Boosted by that 3-1 interval advantage, Gillingham were happy to settle on that, but King was presented with a great chance for his first hat-trick of the season just past the hour mark. Paul Shaw jinked into the area, but was felled by a challenge from Tony Crane and Mr Taylor awarded another spot-kick.
However this time King was denied by an excellent stop from Stringer, who had replaced injured veteran Kevin Pressman.
The youngster was in the wars getting a bang on the head trying to stop Chris Hope heading in Gillingham's fourth, and also needed treatment after colliding with Mamady Sidibe, who was given a second-half run-out on his comeback after missing three games with a hamstring injury.