Sunderland’s pre-season finale ended in a 2-1 win over Hull City on Friday evening at the Stadium of Light.
Ross Stewart opened the scoring midway through the first half, but Magennis’ second-half strike saw the visitors back on level terms.
But in the last minute of the 90, substitute Will Grigg bundled the ball over the line to ensure SAFC ended pre-season with a win.
Following an outbreak of gastroenteritis within the squad, several players missed the contest.
On his Stadium of Light debut, Corry Evans captained the side, while Callum Doyle also had his first home outing.
Stewart led the line, with support from Elliot Embleton, Josh Hawkes and Lynden Gooch.
With the backing of home support for the first time since May, the Lads started on the front foot.
Inside five minutes, Stewart almost latched onto Hawkes’ crossfield pass, but Matt Ingram was out to smother.
But it didn’t take long for Stewart to make his mark on the game, as he opened the scoring midway through the half.
Embleton made a darting run through midfield, and played an inch-perfect pass to Stewart, who composed himself and slotted home.
New number eight Embleton twice went close to doubling the lead soon after, being thwarted by Matt Ingram in the visiting net from distance.
After a quiet opening to the second half, the visitors levelled through Magennis when he prodded home Lewie Coyle’s low cross.
Substitute Aiden O’Brien had the chance to make an instant response, but his header dropped inches wide of the post as it ended level on Wearside.
But in the last minute of the 90, Hawkes’ deep free-kick was headed back across goal for Grigg to bundle home and seal the win.
Next up for Sunderland is their first Sky Bet League One fixture of the season against Wigan Athletic on Saturday.
Sunderland: Patterson, Flanagan, Evans, Doyle, Embleton, Gooch, O’Nien, Stewart, Winchester, Neil, Hawkes
Subs: Richardson, O’Brien, Taylor, Grigg, Diamond, Younger