Richie Wellens's side went into Tuesday's match with matters in their own hands and knowing that victory over their hosts would guarantee them a place in the third tier for the first time since 2015.
However, they trailed 2-0 and had a numerical disadvantage when the floodlights failed in their match, forcing the players to be taken off the pitch, and their promotion was confirmed while they were still in the dressing room waiting for their own game to resume.
The match eventually began again after a lengthy stoppage before finishing 2-0, although by that stage defeat for Bradford City against Swindon Town had confirmed Orient's promotion from League Two.
Omar Beckles was given his marching orders after only 14 minutes for a late challenge on George Lapslie to give Orient an uphill battle early on, and their task was made even tougher when Alex Macdonald broke the deadlock for Gillingham from the resulting free kick.
The visitors' struggles to find an equaliser left them looking for favours elsewhere in the league, with even defeat being enough if either Northampton Town or Bradford City also lost.
Orient's own end of the bargain slipped further away when Gillingham were awarded a penalty 15 minutes from time, with another Macdonald free kick proving costly as it struck a hand in the penalty area.
Cheye Alexander stepped up to take the penalty, and made no mistake to effectively put the game to bed on the night and inflict just a fifth defeat of season on the leaders.
The drama was not over there, though, as a local power cut saw the floodlights fail 10 minutes from time, forcing the officials to bring a halt to the game and take the players back into the dressing room.
During that time, Bradford then fell behind against Swindon Town, and the lengthy stoppage at Priestfield, coupled with Bradford's inability to get back into their game, meant that Leyton Orient's promotion was confirmed before they re-emerged from the tunnel to resume their match.
Wellens's men unsurprisingly saw out the game with little ambition to push for a win, knowing that even the loss left them with an unassailable lead over those outside the top three.
Orient will now set their sights on winning the title, with a commanding seven-point lead over their closest challengers.