Bradford City lead Gillingham at half time at the Coral Windows Stadium thanks to a goal from James Hanson.
Luke Norris curled an effort wide of the target inside the opening two minutes, then powered a header straight into the arms of Ben Williams as the visitors started brightly.
However, the Bantams took the lead against the run of play when Hanson tapped home from a Billy Knott cross.
Gillingham continued to press, however, and were nearly level when Brennan Dickenson's cross deceived Williams, with the goalkeeper needing two attempts to claim the ball at the back post.
Williams was called into action again when he threw out a hand to meet Bradley Dack's powerful strike midway through the half.
Dickenson's corner was then almost bundled into the back of the net by Adedeji Oshilaja, but Rory McArdle managed to divert the ball clear and preserve his side's lead.
No Data Analysis info