Second-half strikes from Keogh and Hinds gave Scunthorpe their first win on the road since October and brought Gillingham back into the relegation dogfight.
Justine Cochrane had put the Gills ahead but they were made to pay for sloppy defending as The Iron pounced on mistakes at the back.
Both teams had chances early on. First Scunthorpe's Andy Keogh put a lob just wide of Jason Brown's right hand post while Cochrane could only shoot straight at Paul Musselwhite from Andrew Crofts' cross.
The visitors continued to look dangerous on the break and Cleveland Taylor should have given them the lead after 16 minutes when he had just the goalkeeper to beat from 15 yards but Jason Brown spread himself to stop Taylor's low shot.
Gillingham eventually found the breakthrough six minutes before halftime. Tommy Black's exquisite back heel split Scunthorpe's defence and this time Cochrane made no mistake side-footing past Musselwhite from 10 yards out.
Yet the lead lasted barely two minutes when Andy Keogh held up the ball in Gills penalty area and laid it back to Sparrow who curled a delightful shot into the top right hand corner from 20 yards.
Gillingham manager Ronnie Jepson's woes were compounded when Richard Hinds put Scunthorpe ahead after 59 minutes. Ian Baraclough's free-kick from 30 yards out on the right drifted onto the crossbar and Hinds reacted quickest to prod the ball past Brown.
Five minutes later and teenage strike Andy Keogh wrapped up the game for The Iron when he slammed home after Taylor had pulled the ball back from the right-hand touchline.
Gillingham poured forward looking for a way back into the game but if anything Scunthorpe looked more likely to extend their lead as the home team left spaces at the back.