Courtney Duffus struck on his debut in the final five minutes of the game to ensure Oldham Athletic maintained their unbeaten pre-season campaign.
Billy Kee put Stanley ahead in the 16th minute as he headed home at the front post past the Trialist goalkeeper.
Athletic struggled to create chances in the opening 45 minutes but 10 minutes after the break, they were level.
Debutant Duffus struck towards goal and an outstretched hand prevented the ball from going over the line.
A penalty was awarded and Craig Davies sent the goalkeeper the wrong way to draw Athletic level.
Latics were a lot brighter in the second half but they were undone on 77 minutes as Accrington Stanley went ahead for the second time.
Mekhi McLeod drove at the defence and unleashed a thunderbolt from the edge of the bow which hit the post and went in.
Latics continued to press and were rewarded with a goal on 85 minutes as Duffus' fierce strike found the bottom corner and earned Latics a draw.