Britt Assombalonga scored twice and Marcus Tavernier was also on target for the home side, but Allan Saint-Maximin pulled one back before half time for Steve Bruce's side.
However Neil Warnock's team - whose first competitive fixture of the season comes on Friday when they face Shrewsbury Town in the Carabao Cup - added two more goals in the second period, through Grant Hall and, from the penalty spot, Stephen Walker.
Both sides also had a man sent off early in the second half, with United skipper Jamaal Lascelles and Boro midfielder Lewis Wing dismissed after an off-the-ball incident.
Assombalonga's opener was a neat finish after some bustling play from the former Nottingham Forest man, although Florian Lejeune felt that he was fouled by the muscular forward before he slotted past Karl Darlow.
His second was a simple finish from close range after good work from Ashley Fletcher, but again owed much to Assombalonga's strength in the build up.
Boro's third was a fierce strike from Tavernier - the younger brother of former Magpies defender James - but Saint-Maximin gave United a foothold in the game after outpacing Hall to reach Sean Longstaff's pass and beating Dejan Stojanovic in the Boro goal.
Hall, who joined the Teessiders from Queens Park Rangers this summer, headed home Boro's fourth in the second half, though, and Walker completed the scoring from the spot after Javier Manquillo was harshly adjudged to have brought down Marc Bola.
The two sides will meet again in another behind-closed-doors training match next Monday, this time at the Magpies' Benton training centre.
Newcastle United: Karl Darlow (Mark Gillespie 62), Javier Manquillo, DeAndre Yedlin (Paul Dummett 56), Jamaal Lascelles, Florian Lejeune (Federico Fernández 56), Jacob Murphy (Matt Ritchie 62), Isaac Hayden, Sean Longstaff (Daniel Barlaser 62), Christian Atsu (Ciaran Clark 56), Miguel Almirón (Andy Carroll 56), Allan Saint-Maximin (Henri Saivet 68)