Donegal were the better team in the second-half and points from Kilcar cousins Ryan and Eoin McHugh put them ahead for the first time with just five minutes remaining.
However, Cavan feel pretty invincible at this level and hit an unanswered 1-3 in the last four minutes to progress to an All-Ireland semi-final against Dublin.
A goal from midfielder Liam Buchanan in the 59th minute, followed by points from Michael Argue, Joe Dillon and Barry Fortune, saw Cavan extend their domination of the Ulster championship.
Swarm defences were on top in a low-scoring first-half, with Cavan leading 1-2 to 0-2 at the break.
Dillon looked sharp and won a lot of ball but he was frequently got bottled up by his two Donegal markers — until he eluded them once in the 18th minute and stuck the ball in the back of the net. Cavan captain Conor Moynagh received a black card after an off the ball incident with Eoin McHugh in the 22nd minute.
The scores were not any easier to come by in the second-half. With the wind at his back, McBrearty converted a free for Donegal four minutes after the restart, which Bouchier soon cancelled out, but Donegal were starting to win more possession around the middle and their confidence grew. Donegal’s best hope of beating the blanket defence was to kick long-range points and midfielder Hugh McFadden landed one from around 47 metres, a rare point from play, in the 39th minute. Donegal hung on in the game and only trailed by a point, at 1-3 to 0-5, after 44 minutes.
With a great sense of timing, McBrearty scored his first point from play with a curling left-footed shot to level the scores with 10 minutes remaining, the first time the sides had been level since the 18th minute.
Cavan were chasing the game as the second-half wore on with Donegal dominating possession. Ryan McHugh’s long-range point put Donegal ahead for the first time with five minutes left and, as the game got more stretched, the players tired.
His cousin Eoin McHugh stretched Donegal’s lead to two but Cavan’s midfielders snatched victory with Liam Buchanan breaking two tackles to drill the ball to the net in the 59th minute.
Michael Argue followed it up with the insurance point a minute later as Cavan’s domination of the Ulster U21 provincial stretched to a fourth year.
Scorers for Cavan – J Dillon 1-1 (1f), L Buchanan 1-0, K Bouchier 0-3 (3f), M Argue, B Fortune 0-1 each
Scorers for Donegal – P McBrearty 0-4 (3f), R McHugh, W Gillespie, H McFadden, E McHugh 0-1 each
CAVAN: J Farrelly; B Fortune, K Clarke, P Faulkner; G Smith, C Moynagh, C Brady; L Buchanan, M Argue; P Graham, E Flanagan, A Watson; D McVetty, K Bouchier, J Dillon.
Subs: A O’Hara for Moynagh (BC, 22), T Hayes for Bouchier (40), E Hession for Flanagan (47)
DONEGAL: J Coll; C Brennan, C Parke, A McCloskey; M O’Reilly, R McHugh, G Gallagher; H McFadden, C Thompson; D Mulgrew, P McBrearty, E Doherty; D O’Connor, W Gillespie, E McHugh. Subs: C Cannon for McCloskey (38), J O’Malley for Doherty (52)
Referee: Cathal O’Hagan (Tyrone).