A largely non-descript 90 minutes, in which two well organised sides cancelled one another out, was won by one moment of quality from Motherwell, a Polworth free-kick enough to open up the Dons defence for Donnelly to score the decisive goal of the game.
After successfully negotiating the weekend's Scottish Cup tie against Dumbarton, Derek McInnes made two changes as Aberdeen returned to league action at Pittodrie. Lewis Ferguson returned to the colours after suspension, Jon Gallagher also into the starting line up, with Bruce Anderson and Connor McLennan dropping to the substitutes' bench.
There were two changes for Motherwell too after their 3-0 win at Dundee in the Scottish Cup. Liam Grimshaw and Liam Donnelly were named in the starting XI in place of Richard Tait and Jermaine Hylton as the Steelmen looked to stay ahead of the Dons in the SPFL table.
Following a scrappy opening, the Dons won a first corner out on the right in the sixth minute, Niall McGinn finding Ash Taylor but the big man was stretching to get his head on it and directed the ball wide.
The Dons began to start piecing things together as the game wore on but with Motherwell sitting deep, creative space was hard to come by in the final third. Yet it was Motherwell who came closest to breaking the deadlock early on, Long firing in a low cross, Joe Lewis getting a touch, Shay Logan positioned perfectly to clear from inside the six yard box in the 19th minute. Moments later, Long collected a caution for blocking Lewis as he tried to take a quick free-kick.
The Dons had their first real sight of goal in the 23rd minute, Logan's cross headed on by Sam Cosgrove, Andrew Considine instinctively trying to finish first time at the back post, his low shot well saved well with his feet by Gillespie.
Long had a glimpse of the Aberdeen goal in the 28th minute, Dylan McGeouch doing well to come across and whip the ball off him. Long fell awkwardly after the challenge and had to limp off, Ilic eventually coming on to replace him. Both sides were down to ten men briefly as Considine was off the field getting treatment for a head injury.
McGinn took a chance from the edge of the box, taking an early shot at goal from 25 yards after Considine found him with a throw-in in the 35th minute, his looping effort flashing well over the bar. Donnelly then collected his tenth yellow card of the season for Motherwell after chopping Ferguson down wide on the right. There might have been another foul going the Dons' way in the 38th minute when McGinn was barged over off the ball by Gallagher, not that the whistler was ever giving a penalty for that.
Ilic turned into space in the 44th minute and got himself an angle to fire off a shot from just inside the box, Lewis blocking it away at the near post. The visitors were awarded a very dubious looking free-kick wide on the right, 40 yards out, as we edged into injury time. Polworth curled in a tempting cross, Donnelly coming in at the back post to win his header and give Lewis no chance to save, a disappointing end to a largely uneventful half of football.
HALF-TIME: ABERDEEN 0 MOTHERWELL 1
The Dons made a quick start to the second half without creating an early chance before Grimshaw was lucky to escape a card after a thumping challenge that flattened McGinn.
The referee was lenient again in the 52nd minute when, after a patient Aberdeen move, Cosgrove was bundled over by Hartley on the edge of the box, but neither a free-kick nor a penalty was awarded.
On the hour, Taylor went down awkwardly, rolling his ankle and requiring treatment before managing to carry on. The Dons were starting to exert some pressure and in the 62nd minute, Gillespie had to go down at Ferguson's feet to concede a corner as he got behind the defence, Taylor then heading over from McGinn's delivery.
Ryan Hedges became Aberdeen's first change in the 69th minute, Funso Ojo making way for the Welshman as Derek McInnes tried to inject some menace into his side. Motherwell responded immediately, MacIver coming on in place of Scott. Hedges was soon in the action, a horrible late challenge from Carroll leaving him on the ground and the Motherwell man in the book.
The Dons came close in the 72nd minute, McGinn's corner in eventually dropping for Considine in the middle of the area, but he couldn't get over the bouncing ball and hooked his effort over the bar.
Hedges had got the measure of Carroll, skinning him down the right, his cross deflected behind. McGinn's corner reached Cosgrove, but his header was clutched comfortably by Gillespie under the bar. Cosgrove then barrelled his way into the box from the right flank before the referee gave a foul against him after a Motherwell man was felled by a sudden breath of wind. Cosgrove was booked for dissent in the aftermath, then the visitors made their last change, Ilic taken off in place of Mugabi as they went to a back five.
A quick free-kick from McGinn had Considine into the box, the left-back scythed down by a defender, referee Collum giving a corner despite the Steelman having got nowhere near the ball.
Curtis Main and Bruce Anderson made their entrance in the 81st minute, Logan and Taylor replaced as the Dons went for broke. Motherwell made a swift break as a consequence, Hedges sprinting back to make a key intervention on the edge of the box to rob MacIver.
The Dons kept pushing but Motherwell defended deep and in numbers, denying space through the final third. It almost came good in the 87th minute though, Hedges receiving the ball from Main and spearing a cross through the six yard box, nobody able to get on the end if it.
Two minutes into injury time and McGinn looked to have manufactured a chance with a cross that ultimately dropped for Anderson, his ferocious shot thumping into Mugabi. That proved the last throw of the dice on an evening where the Motherwell defence ultimately came out on top, the visitors extending their advantage over the Dons to four points.