The towering 22-year-old frontman's goalscoring exploits helped by winger Callum Roberts and first-team outcast Jack Colback ensured United got off the mark in the Premier League Cup, having lost their opening Group D clash in September.
It took Peter Beardsley's men just 11 minutes to open the scoring, when midfielder Colback, who looks certain to leave the club in January, slotted home from the edge of the area.
That lead was doubled within 30 seconds when Roberts turned in via the post.
Liam Cullen halved the deficit just before the half hour mark before Heardman got in on the act, ably assisted by Roberts, he tucked in on 41 and 44 minutes to ensure the Magpies had a healthy lead at the break at Little Benton.
The striker bagged his hat-trick on the hour mark when he fired home after a Victor Fernandez shot was parried by the Swans keeper.
Cullen then got a second, before Heardman restored the four-goal cushion after some good work by Dan Barlaser.
As time ticked away the visitors restored some pride with a third of their own - Adnan Maric getting on the scoresheet, but it was too little too late as the young Magpies ran out comfortable winners.
NUFC U23 XI: Woolston; Sterry, Cameron, Gillesphey, Haidara; Saivet, Colback; Fernandez, Barlaser, Roberts; Heardman.
Subs: Harker, Bailey, Ward, El-Mhanni, Charman.