The Republic of Ireland midfielder launched a free-kick which evaded everyone and nestled in the top corner after 62 minutes. Jamie McCombe had given Town the lead on the stroke of half-time.
Jordan Rhodes, seeking another goal for his 30th of the season, headed over early on before firing wide. But Huddersfield took the lead in first half stoppage time after Darren Potter fouled debutant Kallum Higginbotham in the centre of the field.
Gary Naysmith took a short free-kick to Higginbotham who curled the ball to the far post allowing McCombe to send a towering header back across goal and into the top corner.
The Dons levelled in the 62nd minute. Gleeson, on the far left touchline some 35 yards out, launched his free-kick which went over everyone, including goalkeeper Ian Bennett, and into the top corner.
Town went close to snatching a winner in stoppage time when Jack Hunt's shot hit the underside of the bar and Scott Arfield sent the follow up wide.