The Barnsley man struck the ball cleanly from 25 yards, hitting the top corner of the Gillingham goal with 22 minutes gone. The hosts were two goals up on the half-hour mark, Sam Winnall nodding home a Reece Brown cross.
After a quiet start to the second half, Devante Cole came off the bench for a dream home debut, smashing the ball in off the crossbar from close range and putting his side up by three goals.
Gillingham were given a lifeline on 72 minutes when Jermaine McGlashan was brought down in the box. Danny Kedwell's penalty was saved, although he dispatched the rebound to spark hope of an unlikely comeback.
Those hopes were dampened just four minutes later, however, when Dale Jennings reacted fastest after a Hourihane free kick was deflected into his path, slotting home from a tight angle and wrapping up the points for Barnsley.