A tense affair was to be expected, with unrest in the Pittodrie support following the capitulation at the hands of Rangers last week, and a section of the Hibs support still asking questions about the leadership of Paul Heckingbottom.
Perhaps the best opening of the first half fell to Doidge after just four minutes. The striker was played in neatly by Daryl Horgan, only for Lewis to race off his line to block.
That aside, set-pieces looked the most likely source of a breakthrough, with Tom James flashing an effort across the face of goal for Hibs and Stevie Mallan testing Lewis from distance with a shot that moved wickedly in front of the goalkeeper but was held at the second attempt.
Aberdeen were playing with a front two of Main and Cosgrove, but they too struggled to make any headway, their best effort coming from a Greg Leigh header wide of the target.
However, it took just three minutes of the second half for the game to ignite.
Hibs won a corner on the right, from which James' shot was blocked by Main, Porteous was placed well, and swept home from six yards.
The Dons fans were restless and looking for a reaction – however Main's lunging challenge on Mallan was not it, and the home side were a man down and up against it.
They looked shell-shocked and Lewis and Doidge would come eye-to-eye three more times before the hitman was hooked, Florian Kamberi coming on in his place.
But suddenly there were signs of life from Aberdeen. Substitute Jon Gallagher hit high and wide, but at least it was an effort. Ryan Hedges struck the post from the edge of the area when his effort perhaps deserved better.
Enter Cosgrove. The Dons talisman had barely troubled the visitors for much of the game, but he rose highest at the back post to head home Niall McGinn's corner.
Neither side looked likely to win it from there, but Ferguson had the final say when he was sent off for almost a carbon copy of Main's earlier challenge.