Goals from Jemal Johnson and Jermaine Easter either side of Jordan Rhodes' 55th-minute strike had seemingly put the Dons on course for a fifth straight win.
But Theo Robinson equalised for the Terriers before Kay headed in a corner 12 minutes from the end to hand Huddersfield their first away win of the season.
Johnson put the home side ahead two minutes after the break when he cut inside Lee Peltier on the left before smashing a pile-driver into the top corner from 22 yards.
Rhodes equalised following a goalmouth scramble before Easter put the Dons 2-1 up with a cool one-on-one finish after Jason Puncheon's blocked shot had broken kindly to him.
But Robinson fired in Anthony Pilkington's cross-shot from close range to equalise for the Terriers on the hour mark before Kay nipped in ahead of Dons goalkeeper Willy Gueret to head the winner from Danny Drinkwater's corner in the 78th minute.