South Shields and Sunderland played out a pre-season thriller on a record-breaking day at 1st Cloud Arena.
Julio Arca's men produced a terrific performance against the Championship outfit and twice led thanks to Paul Blackett goals before being pegged back.
A Hemir header and brace from Jack Clarke turned the game in Sunderland's favour in front of a record ground attendance of 4,000, but Dillon Morse's equaliser 10 minutes from the end looked like it may bring the home side a deserved share of the spoils.
Chris Rigg fired in the winner a minute from the end, though, to ensure Sunderland would claim a narrow victory.
Shields acquitted themselves well from the outset and saw plenty of possession in the opening stages, although they were unable to penetrate the visitors' backline.
Some outstanding examples of anticipation at the other end largely kept Sunderland at bay, but there was little the Mariners could do to prevent Clarke skipping inside from the left on 20 minutes before he struck the top of the woodwork from the edge of the area.
The Black Cats were beginning to control proceedings, but Shields remained a threat and took the lead on 26 minutes, with Jordy Mongoy breaking down the left of the area and squaring for Blackett to finish from close range.
There was half a chance for Shields to double their advantage when Gary Liddle's cross from the left caused confusion, but goalkeeper Anthony Patterson claimed the loose ball.
Sunderland had opportunities for a leveller before half-time.
Ellis Taylor flashed a ball across the face of goal which evaded a touch, Tom Broadbent blocked a Lynden Gooch effort and Abdoullah Ba flashed a shot onto the roof of the net.
Clarke was the away team's biggest threat and he struck the upright again when he broke through the centre and crashed a strike against the post.
Hemir was denied by a tremendous Liddle interception towards the end of the first half as Shields took a one-goal advantage into the interval.
Sunderland cancelled that out three minutes into the second half when summer acquisition Hemir headed in from close range.
A number of dangerous attacks came and went before Shields refound their confidence and with it, the lead.
Blackett was again the man of the moment as he chopped the ball onto his left foot and rolled it past Patterson to continue a dream first appearance at 1st Cloud Arena.
Shields' advantage was more short-lived this time, though, with Clarke restoring parity for Sunderland on the hour mark as he slid home a low cross from the right.
The Mariners made a flurry of changes during the second half and many of those introduced grasped their opportunity to shine including James McGeorge, whose 20 yard strike was well saved.
The hosts would not go ahead for a third time, though, with Clarke brushing home his second with 17 minutes left to put Sunderland into the lead for the first time.
The Black Cats would have gone two goals in front if it wasn't for a superb one-handed reaction stop from Shields' trialist goalkeeper, who had been brought on at half-time.
It proved to be an important moment as Shields forced themselves level with 10 minutes remaining.
Substitute Dylan Mottley-Henry somehow worked space for a shot and when his effort was parried, Morse was on hand to prod home from inside the six-yard box.
Rigg ultimately provided the decisive moment on 89 minutes, with the teenager finishing ruthlessly from just inside the area after a cutback from the left.
Shields are back in pre-season action on Tuesday when they welcome Hebburn Town to 1st Cloud Arena.
South Shields: Boney (Trialist 46), Lufudu (Jenkins 68), Adams (c), Liddle (Marriott 68), Broadbent (Morse 62), Smith (McGowan 46), Heaney (Trialist 62), Mongoy (Briggs 46), Blackett (Mottley-Henry 62), Gomes (McGeorge 68), James (Hodgson 46).
Goals: Blackett (26), (56), Morse (80).
Sunderland: Patterson, Gooch (c), Crompton, O'Nien, Taylor, Matete, Ekwah, Lihadji, Ba, Clarke, Hemir. Subs: Richardson, Kenton, Pye, Burke, Lavery, Beattie, Ogunsuyi, Rigg, Spellman, Mitchell, Tutierov.
Goals: Hemir (48), Clarke (60, 73).
Image: Kev Wilson.