An unstoppable 20-yard shot into the top corner from Jordan Baker in the final minute of the game secured victory for Ballymena at Suffolk Road.
Ryan Henderson rifled in the Donegal Celtic opener in the eighth minute but Baker levelled after 33 minutes with a header from a Gary McCutcheon cross.
Eamonn McAllister turned and shot into the top corner on 57 but Ross Black scored with a 22-yard free-kick on 67.
James Costello and McCutcheon went close before Baker's deserved winner.
Thomas Lambe had provided the delivery for Henderson to control the ball on the edge of the box, turn and break the deadlock.
McAllister missed a good chance before Ballymena equalised and then Black fired a volley inches over the bar.
McAllister made amends by putting the home side in front from 18 yards out but Black's effort into the top right hand corner restored parity.
Substitute Costello had only been on the pitch for four minutes when he missed from five yards out.