Gillingham should have been ahead after just three minutes when Simeon Jackson broke away and rounded keeper Adam Collin only to screw his shot well wide. Carlisle had another let-off in the 25th minute when defender Darren Dennehy rose to meet Danny Jackman's free-kick and smacked his header against the bar.
A niggly game boiled over seven minutes from the break when Harte went down clutching his face after an aerial challenge from Rene Howe. Carlisle manager Greg Abbott tried to remonstrate with the referee's assistant and was ordered to the stands by ref Paul Tierney.
The incident fired up the home side, who took the lead in the 41st minute when Daryll Duffy won a free-kick a couple of yards outside the penalty area. Harte cleverly curled the ball over the wall to find the top right-hand corner of the net.
Harte was on target again in the 51st minute, blasting home a penalty after Matty Robson had been tripped inside the box by Chris Palmer.