Julen Lopetegui’s first game in charge was not going to plan as his side struggled to break down the club sitting bottom of League Two.
As frustrations grew, Wolves finally won a penalty and needed returning striker Jimenez, who had not played since August 31 due to injury, to score it in the 77th minute.
Rayan Ait-Nouri then scored a late second, to send Wolves through to the next round.
Wolves dominated possession from the start and created the first opening. A one-two pass between Hugo Bueno and Joao Moutinho saw the former take aim, but goalkeeper Jake Turner was equal to it.
Bueno then put in a delightful delivery from the left, with Diego Costa lurking, but Gillingham cleared their lines.
After the opening 10 minutes, Wolves were almost exclusively in Gillingham’s half but were unable to create any clear opportunities, while the visitors were happy to run the clock down – which prompted Lopetegui to complain to the fourth official about time wasting.
Bueno was the pick of the bunch for Wolves in the opening stages and he once again almost created the first goal with another tidy run down the left. His cross was almost met by Costa, before Joe Hodge had a shocked block.
Costa had a half chance when he met a Daniel Podence ball over the top. He attempted to head it backwards towards goal, but directed it wide.
Gillingham had a chance when they finally ventured forward and won a corner. A scramble in the Wolves box had everyone terrified, but they cleared the danger by the skin of their teeth.
Ruben Neves then came close with a 25-yard free-kick that flashed just past the post.
Although frustrations were high inside Molineux, Wolves did put together a superb passing display that saw a Costa flick put Moutinho in, but the ball ran away from him when he would have had a free shot from 10 yards.
Moments later, Costa was almost in but had to stretch for the ball, and Turner collected it.
Wolves began to pile on the pressure in the closing minutes of the first half. A rasping shot from distance by Podence was saved by Turner but spilled into the box, and Costa was beaten to the follow-up by a defender.
As the search for that elusive opening goal continued, Hodge should have found it. He had a free header from five yards after a Goncalo Guedes cross, but he headed wide.
Hakeeb Adelakun had a hopeful effort from distance for Gillingham, which was high and wide, in one of their few attacks.
The last kick of the ball before half-time saw Neves smash the post with a shot from distance.
Wolves entered the break drawing 0-0 after a painful 45 minutes where they dominated possession, but did very little with it.
As the teams emerged for the second half, Adama Traore replaced Hodge, meaning a change in formation to 4-2-3-1. Podence moved to play behind Costa.
In the opening stages of the second 45, Gillingham were having more joy by punting the ball forward to striker Mikael Mandron. He was doing a good job at holding the ball up and winning headers, as the visitors looked to hurt Wolves through set pieces.
If the first half was painful, the second was even more so as the game ticked beyond the 60th minute. Wolves were unable to inject any urgency and life into the fixture, as the crowd became increasingly frustrated.
In an attempt to change their fortunes, Wolves introduce Matheus Nunes and Hwang Hee-chan, replacing Moutinho and Guedes.
Costa, who had offered very little on the night, came close when he directed a shot narrowly wide. The striker was then given support up front when Jimenez replaced Podence, making his first appearance since August 31. He came on to a big ovation from the home fans.
The pair linked up instantly and a nice Costa flick almost handed Jimenez a good chance, but he was closed down inside the box. Shortly after, Jimenez headed over from a corner.
A huge chance then fell to Wolves. A Nunes ball found Nelson Semedo and his shot was saved – and from the resulting corner, Wolves won a penalty.
Cheye Alexander brought down Hwang and handed Jimenez an opportunity from the spot, which he expertly dispatched.
Ait-Nouri finished off a fine attacking move in injury time to give Wolves a second, in a scoreline that flattered their performance.
Hwang missed a big chance with a chip over the goalkeeper at the death, as Wolves secured a place in Thursday’s quarter final draw.
45 CHANCE Neves hits the post on the stroke of half-time
77 GOAL Jimenez gives Wolves the lead from the penalty spot
90 GOAL Ait-Nouri finishes off a nice move
Wolves: Sa, Semedo, Collins, Kilman, Bueno, Hodge (Adama, 45), Neves, Moutinho (Nunes, 60), Guedes (Hwang, 60), Costa (Ait-Nouri, 81), Podence (Jimenez, 67) .
Subs not used: Sarkic, Lembikisa, Gomes, Ronan.
Gillingham: Turner, Alexander, Tutonda, Wright, Ehmer, Williams (Lee, 73), O’Keefe (Reeves, 73), Mandron (Kashket, 64), Jefferies (MacDonald, 73), Adelakun, Baggott.