The versatile 21-year-old relinquished the captain’s armband to goalkeeper Peter Cherrie to help the Scottish netminder mark his 100th league appearance for the club.
However, Shields stole the headlines with a composed header four minutes from time after Marc Griffin’s corner was flicked into his path.
Prior to that it looked as if Declan Devine’s visitors would take the points. Having dominated for long periods, they eventually found the breakthrough in the 74th minute when Declan McDaid headed home from close range.
Derry were full value for their lead at that stage after McDaid and Stephen McLaughlin, twice, had been denied by the woodwork.
However, Dundalk will feel they deserved at least a point after having what looked a perfect goal chalked out on 63 minutes when Robert Waters’ header was adjudged not to have crossed the line by referee Paul McLaughlin.
DUNDALK: Cherrie; McLaughlin, Foran, Shields, Murphy; Walsh, Mountney, Waters (Rafter 68), Shanahan; McDonnell (Thomas 81), Griffin.
DERRY CITY: Doherty; Madden, McBride, S McEleney, McCaffrey; Morrison (Farren 83), Molloy, P McEleney, McLaughlin; McDaid, Murphy.
Referee: P McLaughlin (Monaghan).