The 19-year-old has committed his future to the club after breaking into the Magpies first team this season under Eddie Howe, making four appearances - three of them coming in the Premier League - so far in 2022/23.
Whitley Bay-born Anderson came through United's Academy before making his senior Newcastle debut in an FA Cup tie at Arsenal in January 2021, with a top flight bow coming against the same opposition later that month.
He spent the second half of last term on loan at Bristol Rovers where he impressed, scoring the goal which sealed promotion to League One for Joey Barton's men on the final day, before returning to Tyneside, with Howe handing him his first competitive start in last month's Carabao Cup win over Tranmere Rovers.
Elliot Anderson said: "I'm really happy. I love playing for Newcastle United, and committing my future to the club is something I've really wanted to do.
"It was my aim coming back into pre-season to work hard and earn the opportunity to stick around. I have really enjoyed being with the first team group, so hopefully I can keep improving and contribute to the team."
Newcastle United head coach, Eddie Howe, added: "We are all delighted with Elliot's development. He is a natural talent, but he also has an excellent work ethic and always wants to learn.
"I know our supporters will be especially pleased to see another local boy coming through from the Academy into the first team. Elliot has earned that chance, and he has set a great example to our young players.
"He is just at the start of his journey at this level but he has a very exciting future ahead and we are delighted that his journey will continue here."
The Magpies' sporting director, Dan Ashworth, said: "Our strategy is not just about who we can buy, it is also about who we have and how we nurture and develop our best young talent.
"It's crucial for the club and our Academy to provide a pathway for our young players and a belief that if they are good enough, they will get an opportunity to play.
"Steve Harper with the Academy and Eddie Howe and his staff have been brilliant with Elliot. They have given him an opportunity and some great coaching and development to enable him to get to this level.
"Elliot has shown he has the attributes to have a successful career at this level and we hope he will be here for a long time to come."