Bradford fought back from 2-0 down to record their second successive home win with a sparkling second-half rally.
Early goals from Mark Bentley and Mick Flynn - both created by Matt Jarvis - gave Gillingham an early advantage.
But defender Mark Bower pulled a goal back before half-time after the visitors failed to clear a corner.
Dean Windass equalised after Kelvin Jack saved his penalty and the striker put Bradford ahead on 82 minutes, before Jermaine Johnson added a fourth.
Bradford: Ricketts, Edghill (Doyle 59), Bower, Wetherall, Parker, Jermaine Johnson, Schumacher, Bridge-Wilkinson, Holmes (Rogers 83), Windass, Graham (Eddie Johnson 59).
Subs Not Used: Saynor, Clarke.
Goals: Bower 43, Windass 61, 82, Jermaine Johnson 90.
Gillingham: Jack, Jupp, Cox, Sancho, Jackman, Bentley, Flynn, Crofts (Pouton 85), Jarvis, McDonald (Ndumbu-Nsungu 64), Mulligan (Spiller 87).
Subs Not Used: Johnson, Easton.
Booked: McDonald, Ndumbu-Nsungu, Sancho.
Goals: Bentley 6, Flynn 14.
Ref: P Miller (Bedfordshire).