Donegal ended Cork's 100% record in Division 1 of the Football League although the home side had to hold on in the closing stages after skipper Michael Murphy's sending off.
The sides were level at 0-5 to 0-5 at half-time after Martin O'Reilly hit three of Donegal's points.
Donegal hit five unanswered points after the break but Murphy was then dismissed after his second yellow card.
Tomas Clancy's goal cut Donegal's lead but the side managed to hold on.
Cork played with the aid of a healthy breeze in the first half but two O'Reilly points helped Donegal take a 0-3 to 0-1 lead by the seventh minute.
The Rebels responded by hitting three of the next four scores to level the game and that remained the position at the break after points at either end from O'Reilly and Mark Collins.
However, Donegal produced one of their typically strong third quarters as a Patrick McBrearty free started a run of five straight home points.
O'Reilly's fourth score of the day could have been a goal but he elected to take his point after being put though.
The score was immediately followed by a magnificent Murphy '45 but that proved to be the Donegal captain's final involvement as he was then dismissed after picking up his second yellow card of the afternoon.
Cork were right back in the game with 15 minutes left as Clancy netted from close range after being set up by Brian Hurley.
The goal left only two between the teams and after Colm McFadden and Ryan McHugh then contrived to miss a glorious Donegal goal chance, a Hurley score at the other end left the minimum between the teams.
However, a McBrearty score steadied Donegal and after O'Neill responded with another Cork free, the home side dug in to take the two league points.
Allianz Football League results
Tyrone 0-11 1-08 Derry
Cavan 0-08 1-09 Down
London 0-06 1-18 Longford
Waterford 0-09 0-11 Carlow
Kerry 0-15 1-10 Dublin
Donegal 0-12 1-08 Cork
Mayo 3-15 0-11 Monaghan
Roscommon P-P Meath
Kildare 0-12 0-15 Westmeath
Galway P-P Laois
Limerick 1-06 2-16 Armagh
Louth 1-16 1-10 Wexford
Fermanagh 2-09 0-11 Tipperary
Clare 0-22 1-13 Sligo
Wicklow 2-06 2-18 Offaly
Leitrim 1-13 1-18 Antrim