Jose Baxter's injury-time goal ended a run of five league games without a win for Oldham and extended Hartlepool's winless streak to 18 matches.
The former Everton forward opened the scoring after he rounded the keeper and coolly tapped home.
Hartlepool responded when Anthony Sweeney smashed home the equaliser, but they had Neil Austin sent off.
Jack Baldwin's handball gave Baxter a penalty, which Scott Flinders saved before he fired home the rebound.
VIEW FROM THE DRESSING ROOM
Oldham manager Paul Dickov told BBC Radio Manchester:
"We've conceded a few in the last minute during my time here, so it's nice to get a winner without being at our best tonight.
"Our endeavour and desire to go ahead and get the win after a disappointing run of results was fantastic.
"To come here at any time is tough, especially after a long journey to Bournemouth on Saturday.
"We showed the right attitude tonight to get the three points."