The Robins' opener came through Jordan Sinnott from 12 yards, before their second came after a penalty was awarded when Ian Gayle handled and Michael Rankine fired home.
James Lawrie struck a third, Damian Reeves' headed in a fourth and Rankine notched his second from inside the box.
Altrincham sit 22nd, three points from safety with one game to play.
Welling United were relegated after their game at Chester and are bottom of the table.
Altrincham kept their hopes of survival in the National League alive by thrashing relegated Welling United.