The sides were deadlocked entering injury-time but Eoin McHugh pounced for the winning score after Ronan Stack had spurned a glorious chance for the hosts down the other end of the field.
“The never say die attitude was pleasing. When you are a manager or a coach you look for your team to give absolutely everything.
"I thought out boys did that in the first half and the second half, and after a number of setbacks they still ground it out,” said Donegal manager Rory Gallagher.
“It’s important to win. We were disappointed when Kerry came to Letterkenny and won, but we’ll just focus on the next game now. We’re delighted with two points and to get out of it, and we’ll take the learnings out of it like we did last week.”
Conor Devaney’s stunning 65th-minute goal looked to have earned a draw for the Rossies who led by three points at the break, having played with the aid of a strong wind.
But McHugh fastened himself to the end of a flowing Donegal counter-attack to glide over the winner.
“It’s very hard to take. We put so much into the game, but it didn’t work out. However, I can’t fault anybody’s effort. It was an outrageous effort,” said Roscommon boss Kevin McStay.
“We had the winning of the game at the death. That’s disappointing but I’ve just told the players that we’ll put this behind us very quickly.”
Ciaráin Murtagh’s 22nd-minute goal, after Donegal messed up a short kick-out, was the defining score in the first half.
Overall, there was little to separate the sides with Ciarán Thompson catching the eye for the winners.
Thompson kicked two points, but Michael Murphy (two frees), Patrick McBrearty (free), Micheál Carroll and McHugh also pitched in with scores.
Roscommon enjoyed their moments too, with Fintan Cregg, Murtagh (two frees), Enda Smith (2) and Kevin Higgins (2) finding the range to give the home side a 1-7 to 0-7 interval lead.
The second half was frenetic as Donegal chased the game. The sides were level after 52 minutes as Thompson, Eoghan Bán Gallagher, McBrearty, James Brennan and Martin O’Reilly replied to a brace of points from Murtagh.
Both sides missed goal chances as Brennan was denied by a Niall McInerney block, while Devaney blazed a good chance just past the post.
When McHugh’s lead score was followed by a couple of more points from O’Reilly, Donegal looked to have done enough.
But Devaney conjured up a piece of magic from a ’45 to seemingly rescue a draw for his side. But McHugh pounced for a winner.
M O’Reilly, E McHugh, C Thompson (0-3 each); M Murphy (2 frees), P McBrearty (0-2 each); M Carroll, E Bán Gallagher, J Brennan (0-1 each).
C Murtagh (2f) (1-4); C Devaney (1-0); E Smith, K Higgins (0-2 each); F Cregg (0-1)
M A McGinley; C Ward, N McGee, P McGrath; R McHugh, E Bán Gallagher, P Brennan; J McGee, M Murphy; C Thompson, M O’Reilly, E McHugh; P McBrearty, M Carroll, J Brennan.
M McHugh for Brennan (17), F McGlynn for M McHugh (h-t), D O’Connor for McBrearty (49), C Gibbons for Brennan (63), E Doherty for McGee (68), H McFadden for O’Connor (70, b/c).
C Lavin; S McDermott, T Featherston, N McInerney; R Stack, S Mullooly, J McManus; K Higgins, T O’Rourke; S Killoran, C Devaney, C Murtagh; D Smith, F Cregg, E Smith.
T Corcoran for Higgins (47), N Kilroy for Cregg (49), C Connolly for D Smith (58), G Patterson for Murtagh (65).
D O’Mahoney (Tipperary).