Sean Higgins's drive drew the home side level 20 minutes after the interval and Barry Smith's side fired a late winner.
Stephen O'Donnell's initial shot hit the crossbar but the rebounded was slotted home by Craig Forsyth with three minutes left.
Dundee: Douglas, Irvine, McKeown, Weston, Lockwood, Riley, O'Donnell, Harkins, Forsyth, Higgins, McCann. Subs Not Used: Gibson, Benedictis, Stewart, Rennie, Bartlett.
Goals: Higgins 65, Forsyth 87.
Queen of South: Hutton, Craig Reid, McGuffie, Lilley, Harris, Weatherston, Johnston, McKenna, McLaren (Carmichael 75), McMenamin, Holmes. Subs Not Used: McKenzie, McShane, Orsi, Holt.
Booked: Weatherston, McKenna.
Goals: McMenamin 34.
Att: 4,242
Ref: Craig Thomson
Source: BBC Sport
Source: BBC Sport