Down pulled off a major upset in the Ulster Championship quarter-final, defeating defending champions Donegal 3-21 to 1-21 at O'Donnell Park in a thrilling match.