Barry Smith’s side, who are waiting to receive Rangers’ Clydesdale Bank Premier League share to rubber-stamp their promotion, were held to a goalless draw over 120 minutes before prevailing 4-1 from the spot.
The visitors sported SPL-style numbers on their shirts but – in front of 844 fans – they did not look a top-flight squad.
An injury crisis forced manager Smith to name himself as a substitute alongside the half-fit Jamie McCluskey on an otherwise youthful bench, though Matt Lockwood started despite uncertainty over his contract situation.
John Baird volleyed over inside a minute and Neil McGregor headed wide from a corner, but the Blue Toon went close when Rory McAllister’s shot flashed just wide with keeper Rab Douglas beaten.
Douglas had to be at his best midway through the first half to save Scott McLaughlin’s free-kick.
But Dundee threatened before half-time when Graham Webster met a corner and his header was cleared off the line by Scott Ross for another corner, from which keeper Paul Jarvie denied McGregor.
Jarvie saved from Leighton McIntosh and Ryan Conroy before the interval but it was Peterhead strikers Robbie Winters and McAllister who saw shots go just wide at the start of the second half.
McGregor took the sting out of McAllister’s 70th-minute effort before Baird went close for Dundee.
Peterhead had a late goal disallowed for a foul by McAllister, taking the match to extra-time.
Webster beat Jarvie to Gary Irvine’s long ball but could not divert it on target, while Declan Gallagher prevented McAllister reaching a long ball at the other end.
Home substitute Bryan Deasley should have scored when picked out by McAllister at the far post and McGregor and Douglas did well to deny Deasley and McLaughlin respectively.
That set up the shoot-out and Douglas saved from Callum McDonald before McLaughlin hit the crossbar as Kevin McBride, Baird, Irvine and Conroy gave Dundee victory.