The young Magpies led inside 20 minutes through Charlie Wiggett's glancing header before the hosts extended their advantage in three second-half minutes, courtesy of Anderson's penalty and Dylan Stephenson's seventh goal in seven Premier League 2 fixtures in front of the Gallowgate End.
Boro cut the deficit shortly after through Isaac Fletcher's header before United's second-string added gloss to the scoreline following Cain Sykes' stoppage-time own-goal.
After five competitive defeats in a row for Newcastle's youngsters, Anderson - who made his Premier League debut for his boyhood club against Arsenal in January - was pleased with the desire and determination shown to ultimately prevail against their local rivals.
The 18-year-old told nufc.co.uk: "The team's really chuffed with the result after losing our last three league games. We'd been leading at half-time in two of those and today we were in the same situation.
"We came in at the break and we knew we had to pull through this time. We stuck in, defended well and saw the game out.
"It was important (to get the goal in the first-half). We started the game well as a team and scoring was good to get us going and being on the front foot.
"Coming out at half-time, you want to get off to a good start. We did that which took away that bit of pressure of being one-up and trying to defend. Being two ahead gives you that bit of breathing space and we managed to improve on that, scoring two more."
Despite losing three successive matches before tonight's emphatic victory over Boro, Newcastle now sit in sixth place, one point adrift of the Division Two play-off spots.
Anderson, however, admitted the squad had full belief in coming out on top and believes securing maximum points can only benefit the side ahead of a busy schedule this month, playing seven games in all competitions.
"It was a good team performance and we're all chuffed to win," the England under-19 international added. "Dylan is scoring again, I think it's seven in seven now!
"It was a good game for quite a lot of people. You can see the work they've been putting in during training and individual performances are getting better.
"Going into games knowing you've been beaten are tougher than the ones you go into when you've won. We believed we could win the game and luckily we did which only gives the team extra confidence."