A James Ryan hat-trick cemented Accrington's position in the League Two play-offs and left Barnet on the brink of relegation.
Ryan put Stanley ahead with a super strike from long range before Mark Marshall levelled after Jack Midson's through ball.
The hosts restored their lead when Ryan's free-kick deflected off the wall and beyond visiting keeper Sam Walker.
Ryan wrapped up the win with another strike from the edge of the area.
Barnet must win next week at home to Port Vale and hope that Lincoln fail to beat Aldershot at Sincil Bank.
Stanley have now assured themselves of a fifth placed finish and will play either Torquay, Stevenage or Gillingham in the play-offs.