Jackson (left) beat his marker Knight to score Gillingham's goal
James Milner marked his 23rd birthday with two goals as Aston Villa saw off a dogged Gillingham side in a hugely entertaining FA Cup tie.
His first came from Adam Miller's error but Gillingham replied well with Dennis Oli and Simeon Jackson going close.
Nathan Delfouneso wasted a great chance when he volleyed wide and was made to pay when Jackson beat marker Zat Knight to equalise on 57 minutes.
But when Miller fouled Ashley Young in the box Milner won it from the spot.
Gillingham began brightly so Villa were fortunate to go ahead on 13 minutes.
Stiliyan Petrov and Milner combined well after captain Miller lost possession on the edge of the box with Milner curling the ball into the left-hand corner.
But rather than being deflated by the early goal, Gillingham went on the attack.
Gary Mulligan served notice of intent when his twists and turns on the right wing left his marker on his backside, and fired the ball in to Oli, who shot just wide of the post, although an off-side flag would have ruled it out anyway.
Milner gifted the Gills another chance when his backpass put his defence under pressure, and only an expertly-timed Knight challenge took the ball off Jackson's toes.
After enduring something of a battering from the home side, Villa had a great chance to double their lead just before the break.
Milner sent over a beautiful cross to Delfouneso, who wasted the chance, volleying over when he had more time then he realised.
Villa began the second half brightly, with Simon Royce forced to make a fine double save from Milner and Delfouneso, but when the next goal came, it was for Gillingham.
The diminutive Jackson had been closely marked by Knight all afternoon but judged Mulligan's flick-on perfectly to turn the Villa defender, sprint to the edge of the box and unleash an unstoppable shot past Brad Friedel.
The pace of the game was relentless, with Craig Gardner having two shots blocked as Villa tried to kill off their opponents, and tempers began to fray on the pitch and on the touchline.
The longer the game went on, the more Villa's class began to show and eventually it paid off when Young was sent sprawling in box by Miller.
It was a debatable decision, with suggestions that Young went down easily.
But the referee had a perfect view and pointed to the spot, from which Milner scored on 79 minutes.
As time ran out Gillingham hurled everything into attack but in the end they were just found short.
Gillingham striker Simeon Jackson:
"It's a sweet and sour feeling - I thought we had a chance but it wasn't to be so it's back to Aldershot on Saturday
"We knew it would be difficult for them as they're not used to our home ground, so we set out to do a job - another 10 minutes and we might have had a replay.
"From where I was standing it looked like he (Ashley Young) went down a bit easy but the referee had a better view than I did and he gave it."
Aston Villa manager Martin O'Neill:
"If our players didn't know they were in a contest early on they knew after 10 minutes.
"Never for one minute did I feel comfortable, Gillingham were always in the game even when we were leading 1-0.
"They got the equaliser and the game could have gone either way, but I felt we were dangerous enough on the break."
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.