Matty Taylor, Sean Powter and Rory Maguire – the latter pair in the space of two minutes in the second half – all hit the back of the net at Pairc Ui Rinn.
Donegal battled from four points down and their powers of recovery looked like they might summons a big comeback again when Aaron Doherty hammered over an equaliser with three minutes left on the watch.
In a frenetic finish, sub Stephen Sherlock inched Cork in front and Colm O’Callaghan fisted the insurance in front of 7,451 to give John Cleary’s side a second win in the group.
Jim McGuinness’s Donegal were unbeaten in 12 League and Championship matches as they headed for Leeside and with Patrick McBrearty on form they made the early hay.
McBrearty, who was making his 150th appearance for the county, is the sole survivor from Donegal’s All-Ireland winning team of 2012.
He was just 17 and had just played for Donegal minors in the curtain-raiser in Ballybofey when McGuinness drafted him to the senior panel.
The Kilcar man has been pretty much a mainstay since and it was McBrearty who led the delegation to McGuinness’s home in Creeslough last summer to sound him out about a possible return.
McBrearty, the Donegal captain, might have marked the landmark day with a goal in the 11th minute. After a sweeping Donegal move, involving Daire O Baoill and Shane O’Donnell, Oisin Gallen off-loaded for McBrearty, whose powerful effort was turned over the top by Cork goalkeeper Christopher Kelly.
McBrearty hit Donegal’s first three points as they led 0-3 to 0-1, but Cork hit back and Taylor turned on the afterburners for a goal in the 19th minute.
Taylor ate up the space and riffled past Shaun Patton to the bottom corner.
However, Donegal hit six of the final seven points of the first half to turn the tables again, with corner-back Ciaran Moore popping up to score twice.
Donegal were 0-9 to 1-4 ahead at the short whistle and Donegal were indebted to Patton who thwarted O’Callaghan at point blank range late in the half.
Just two minutes into the second half, space opened up and Power powered clear to take full advantage, lashing home.
Donegal had barely had time to shake their heads clear before Cork struck again, Maguire batting into the net after the visitors failed to clear their lines to open up a four-point lead, 3-4 to 0-9.
A 30-metre free by Brian Hurley stretched the advantage further.
In a 20-minute spell after McBrearty curled over a free in the 47th minute, Donegal chipped away at the deficit.
Caolan McGonagle stirred the away support when narrowing the margin to one and Doherty teed up the grandstand finish.
Scorers – Cork: M Taylor, R Maguire, S Powter 1-0 each; B Hurley 0-3,2f; C Jones, C O’Callaghan 0-2 each; P Walsh, S Sherlock 0-1 each. Donegal: P McBrearty 0-7 ,3f; O Gallen 0-3, 2f; C Moore 0-2; N O’Donnell, C McGonagle, R McHugh, A Doherty 0-1 each.
Cork: C Kelly 7; K Flahive 6, D O’Mahony 6, M Shanley 7; R Maguire 7, T Walsh 6, M Taylor 8; I Maguire 7, C O’Callaghan 7; P Walsh 7, S Powter 8, B O’Driscoll 7; C Jones 6, M Cronin 7, B Hurley 7. Subs: S Sherlock 7 for Jones (50), T Clancy 6 for T.Walsh (57), R Deane 6 for Cronin (65), E McSweeney 6 for Hurley (69), S Meehan 6 for Walsh (70+3)
Donegal: S Patton 6; E Gallagher 6, B McCole 6, C Moore 7; R McHugh 7, C McGonagle 6, P Mogan 7; J McGee 7, M Langan 7; S O’Donnell 6, C Thompson 7, D Ó Baoill 6; P McBrearty 7, O Gallen 7, N O’Donnell 6. Subs: A Doherty 7 for Ó Baoill (h-t); O Doherty 6 for McGee (40); J Brennan 6 for N.O’Donnell (53), J Mac Ceallabhuí 6 for S.O’Donnell (61)
Referee: B Griffin (Kerry)