The 20-year-old has been rewarded with a new deal after a 2019/20 campaign which saw him make his first team debut for the Magpies in the Emirates FA Cup as well as breaking into the squad for a handful of Premier League matches.
Allan - who set up a goal for Joelinton after making his bow from the bench against Rochdale in January - finished last season as United's leading goalscorer at under-23 level and, having trained regularly with Steve Bruce's first team this year, was named among the substitutes for top flight games against Wolverhampton Wanderers, Everton, Manchester City and Tottenham Hotspur.
Although he has yet to make his league debut for Newcastle, the new contract demonstrates the club's faith in the quick and direct attacker as he heads to Accrington for valuable senior experience.
Born in Ashington, former Cramlington Juniors player Allan joined United in 2012. He is capable of playing out wide or up front, and enjoyed success in a more central attacking role last term as he hit 17 goals in all competitions at second-string level before the season was cut short.
Stanley, whose players returned for pre-season training at the beginning of this month, finished 17th in League One last term.
Earlier this week, Newcastle goalkeeper Jake Turner joined League Two Morecambe on loan for the season.
Watch an interview with Tom Allan about his new contract and his loan move to Accrington for free on NUFC TV