A goal from Curtis Weston just before half-time deservedly booked the Gills a place in the draw for Round Three tomorrow afternoon.
For the second round running the Gills outplayed League One opposition and will be hoping for a big name home or away - something the 1400 fans who travelled to East London and gave their heroes wonderful voiciferous support definitely deserve.
Remarkably it is the third time in four years that the Gills have reached this stage losing out to Accrington Stanley and Aston Villa on the two previous occasions.
Gillingham boss Andy Hessenthaler was forced into three changes, with unavailable on loan strike pairing of Frank Nouble and Jo Kuffour being joined on the sidelines by the suspended Matt Lawrence.
Returning to the starting XI were Danny Jackman and Lewis Montrose wile Stefan Payne made his first start.
After a nervy and tense opening quarter of an hour, Montrose had the first shot in anger in the 16th minute, his 30-yarder forcing Ben Alnwick to save low to his right.
A minute later and Danny Kedwell robbed former Gills loanee Ben Chorley wide on the right. He took the ball forward before cutting it back to Curtis Weston, but his shot was blocked at close range.
The huge contingent of travelling supporters screamed for a penalty but referee Phil Gibbs waved away appeals.
Although the O's had a fair bit of possession they rarely threatened Ross Flitney's goal, Leon McSweeney firing wide from long range.
A dubious free-kick awarded around 25-yards out saw the home side finally get a shot on target just before the half-hour, however Lee Cook's strike found the safe hands of the Gills keeper.
The Gills were dominating possession and a 38th minute cross from the hardworking Charlie Lee into the area found Kedwell, whose header looked to hit the hand of Chorley at close range. Again Mr Gibbs decided against awarding a penalty and was jeered loudly by the Gills masses.
A Lee free-kick was headed back across goal to Kedwell who headed forward, but Weston was just unable to get a touch.
The Gills deservedly took the lead in the 45th minute, a quick long throw from Lee found Weston running into space, and he hooked the ball across Alnwick and into the far side of the net. It was the midfielder's second goal of the season, the first also coming against League One opposition in the First Round replay.
Russell Slade made two changes for the out-of-sorts O's at the break introducing Terrell Forbes and Jamie Cureton.
Another long throw from Lee in the 48th minute found it's way to Kedwell who hooked the ball over from the edge of the area.
Weston then beat Scott Cuthbert to the ball down the right, Alnwick deflected his cross away from goal and Stefan Payne couldn't react as the ball was cleared by Forbes.
Montrose went into the book in the 51st minute after tugging back Cook.
The Gills had a good chance to go two up in the 56th minute. Alnwick scuffed an attempted clearance straight to Kedwell but recovered well to block the forwards effort from point blank range.
An error by Martin, losing possession in a dangerous area, led to Andy Frampton fouling Kevin Lisbie just outside the area, but Cook failed to get the resultant free-kick on goal.
Substitute Cureton did put the ball in the back of the net in the 63rd minute, but the referee assistant's flag was up for offside.
Moments later up the other end Kedwell dragged his shot across the face of Alnwick, but unfortunately for him, also the far post.
In the 67th minute Cureton got goalside of Garry Richards as Jack Payne misplaced a back header, but the veteran striker fluffed the opportunity.
Before the game restarted Dennis Oli replaced Stefan Payne as Andy Hessenthaler made his first change.
As the minutes ticked by the home side were pushing further and further forward with skipper Stephen Dawson orchestrating things from midfield but the Gills, with their 1400 fans in full voice, stayed strong.
Ten minutes from time Slade played his last hand by introducing Dave Mooney for George Porter. The striker had scored the only goal in the pre-season friendly between the two sides.
The Gills looked to be tiring but went close again when Jackman curled a free-kick into the area but Oli could only glance wide of the far post.
Lee then picked out the excellent Weston with a ball forward but the midfielder clipped his shot just over the top.
Flitney punched a dangerous ball in from Cook clear as Cureton looked to pounce, then Dawson went down cheaply in the area as Jackman cleared.
Weston, who'd run himself into the ground, was replaced by Matt Fish in the first minute of stoppage time and it was the substitute who fired an effort at Alnwick from distance.
With time almost up a game of head tennis in the Gillingham area almost led to a heartbreaking equaliser. The ball dropped to Cook who smacked a fierce effort against the underside of the bar which thankfully bounced to safety.
A nervous ending but a thoroughly deserved victory over yet another League One side - who knows what ball 50 will bring in tomorrow's Third Round draw.
Attendance: 3763 (1400 Gills)
Leyton Orient: Alnwick, Chorley (Forbes H/T), Cuthbert, Dawson, Lisbie, McSweeney, Porter (Mooney 79), Spring, Laird (Cureton H/T), Cook, Clarke.
Unused subs: Butcher, Cestor, Smith, Lobjoit, Clarke
Gillingham: Flitney, Lee, Richards, Frampton, Martin, J Payne, Montrose, Jackman, Weston (Fish (90 + 1), S Payne (Oli 67), Kedwell.
Unused subs: Davies, Rance, Essam, Evans, Gazzaniga
Referee: P. Gibbs