The vast improvement which manger Sandy Clark has brought about was maintained as Berwick deservedly battled through to ensure a third round tie at home to Brechin.
Dumbarton were worthy opponents but it was Berwick's power allied to Darren Smith's skill which turned the game in the last 15 minutes.
Eddie Annand, a hat-trick star on his last appearance, put Dumbarton ahead after 24 minutes with a fine header.
Six minutes later the tireless Pat Clarke equalised with his first senior goal. He shot home after goalkeeper Steven Bonar made two great saves.
Dumbarton, playing some slick attacking football, almost went ahead when substitute Chris Boyle saw a flying header rebound off the crossbar.
Smith then took over with some superb individual work on a pitch soaked by torrential rain.
A spectacular solo run after 73 minutes enabled him to break clear and pass to Gordon Connelly who drove firmly into the net from 10 yards.
Ten minutes from time the winger did even better. Picking up a clearance from Andy Seaton he accelerated past two defenders then squared accurately to Gareth Hutchinson who finished off in style.