Allen first took the reins at Underhill in 2003 and returned in March last year, only to leave three matches into an eight-game contract to become Notts County manager.
The 46-year-old was sacked by County in February and succeeds outgoing former Northern Ireland manager Sanchez (pictured) for the final three games of the season, with the Bees three points above the relegation zone and without a win in eight matches.
A statement released on Barnet's official website, www.barnetfc.com, read: "Barnet FC would like to announce that a new manager has been appointed to take over the running of the first team until the end of the season.
"The manager, who will replace Lawrie Sanchez as of immediate effect, will be Martin Allen. He will take charge for the last three games of the 2011-12 season."
Sanchez was appointed as Barnet manager in May last year but only won 15 of 53 games in all competitions.