The 22-year-old striker rose to head home Lee Tomlin's corner in the 86th minute to register his 19th goal of the season, but the point was not enough to lift Posh out of the bottom three.
Neil Danns slammed home the game's opening goal when following up a rebound just before half-time and, after Tomlin had equalised for the visitors five minutes into the second period, defender Murray Wallace headed his first goal in English football as Huddersfield regained the lead.
The point was enough to lift the Yorkshire side out of the relegation zone, but they are one of three clubs who are only a point better off than the two clubs in the bottom three below them, Blackburn and Peterborough.
The home side were quickest out of the blocks with Sean Scannell pulling a shot wide from inside the penalty area and midfielder Oliver Norwood firing a 30-yard effort just off target.
The opening goal looked likely to come via a mistake or a long-range effort, so it was no surprise when Huddersfield's breakthrough just before the interval was as a direct result of another Norwood blockbuster from 30 yards.
Posh goalkeeper Robert Olejnik did well to keep out Norwood's initial drive, but when the ball spilled on the edge of the six-yard box, Danns pounced to lash it into the roof of the net.
But Peterborough were back on level terms soon after. Mendez-Laing made space on the right side of the area and pulled the ball back for Tomlin to fire past helpless Town keeper Alex Smithies from 12 yards.
Mendez-Laing rifled a shot over the bar when well-placed on the edge of the area, but Huddersfield struck the next significant blow in the 69th minute. Norwood was instrumental again, his cross from the left picking out defender Wallace, who powered his header beyond Olejnik from six yards.
Clarke fired in a 25-yard shot that flew wide as Huddersfield looked to increase their lead, but with four minutes remaining Tomlin whipped in a corner from the right and Gayle's downward header at the far post denied Huddersfield two points in their fight for survival.
- Sports & Recreation
- Lee Tomlin
- Oliver Norwood