Goodwillie’s 64th-minute strike, along with Andrew Considine’s opener and a James McPake own goal, proved too much for Dundee who got back into the game with goals from Gary Harkins and and a David Clarkson penalty.
Considine broke the deadlock after just five minutes, Goodwillie found the centre-back in the middle of the box and his accurate header evaded the reach of Aberdeen’s Kyle Letheren.
However their lead was short-lived – Dundee levelled proceedings just a minute later. Jim McAlister’s pass found Gary Harkins who fired a fierce shot from the edge of the box into the back of the net to emphasise the frantic opening period of the game.
The home side pressed to take the advantage, with efforts from Dundee’s Paul McGowan and David Clarkson missing the target as both sides pushed to capitalise on the end-to-end nature of the contest.
It was Aberdeen though who took the lead midway through the first half. Dundee were able to deal with a cross into the box and, while under pressure from a looming Shay Logan, James McPake headed into his own net to hand the advantage to the visitors, who took their lead into the break.
Paul Hartley’s side came out for the second half rejuvenated and dominated the start of the second period in pursuit of an equaliser, and it came after just nine minutes later.
Referee William Collum adjudged Aberdeen’s Ash Taylor to have fouled McAlister in the box and, after pointing to the spot, Clarkson atoned for his earlier missed chances and drew his side level with a well-struck spot-kick down the middle of the goal.
Less than ten minutes later however, the tide had turned in favour of the visitors, Aberdeen scoring the game’s crucial goal. Goodwillie was unmarked in the Dundee box and pounced on Logan’s cross to head into the top-right corner and ensure his side left Dens Park with the three points.
Aberdeen move up to fifth in the Scottish Premiership table after the victory while Dundee, who missed the chance to draw level with their opponents, see themselves six points behind the Dons in eighth.