Arbroath trailed three times before eventually beating Dumbarton.
Bryan Prunty fired the hosts ahead but Lee Sibanda curled home to level for Arbroath. The Sons regained the lead when Mark Gilhaney netted.
Gavin Swankie's strike equalised for the visitors again but Kevin Nicholl headed Dumbarton into a 3-2 lead.
Swankie's second restored parity and Arbroath were then awarded a penalty for a foul on Steven Doris, who converted from 12 yards to win it.
Ewings, Lyden, McNiff, Nugent, Creaney (Ramage 85), Gilhaney, McBride (Brannan 72), Nicoll, Walker (Winters 72), Prunty, Agnew. Subs Not Used: Grindlay, Wallace.
Nicoll, Lyden, McNiff.
Prunty 5, Gilhaney 17, Nicoll 38.
Hill, Girvan, Wedderburn, Kerr, Brown, Busch, Falkingham (Gibson 76), Sibanda (Ardallany 59), Sheerin, Swankie (Bryce 79), Doris. Subs Not Used: White, Malcolm.
Sibanda 14, Swankie 27, 46, Doris 68 pen.