David Graham's double-strike helped Gillingham record their third win of the season and ruined Leyton Orient's 100 per cent away record.
Graham lit up Priestfield with a dazzling first-half opener - his first for the club - and added his second shortly after the break to hand the managerless Kent side a valuable win.
The home side made most of the running early on and their patient build-up play was rewarded in the 25th minute with a goal right out of the top drawer.
Moments after Sean Thornton had blazed over for the Orient, Delroy Facey's neat lay-off fell to Graham and the striker fizzed a low effort from 25 yards into the corner of the net.
Orient responded with intent and within minutes Wayne Gray missed two glorious chances for the Londoners - a toe-poked effort denied by Simon Royce before the striker slid another chance wide from Wayne Corden's pass.
Adam Boyd should have levelled for Orient moments after the interval but he failed to turn home Corden's cushioned cross from a yard out.
They were made to pay in the 53rd minute when Graham scored his second of the night, stroking home Facey's centre from 10 yards after the burly striker had powered past two defenders.
Gillingham, playing with a renewed confidence following their weekend draw with Leeds, went further ahead on 69 minutes, Barry Cogan bundling Nicky Southall's free-kick past Stuart Nelson with his chest.
But Orient, who staged a magnificent comeback at Bristol Rovers at the weekend, refused to lie down and substitute Jabo Ibehere's precise, angled finish from Boyd's flick gave them a glimmer of hope.
Boyd then drew Royce into a first-class save, the veteran stopper palming away the striker's fierce close-range effort.
And the keeper produced another wonderful stop in injury-time to deny substitute Charlie Daniels as the Gills held on.