Carlisle piled on the pressure in search of the equaliser, but left themselves short at the back allowing McDonald to profit from a weak Courtney Meppen-Walter back pass in the 88th minute, finding space to slip the ball wide of Pickford.
Carlisle's last-minute goal came from a Leon Legge header which flew in past his own keeper.
He admitted: "We dominated most of the game and the defeat was incredible and very cruel. We hit the post and bar and their keeper pulled off saves. They got away with three points while we are left scratching our heads and wondering why.
"I feel the lads should be rewarded for their effort and I am positive we can put it right. Their heads never dropped and overall we were the better team."
Kavanagh was pleased with the performances of his recently acquired on-loan players including Sunderland keeper Jordan Pickford who impressed on his debut. "He was outstanding and will become a top class keeper," he said.
- Sports & Recreation
- Jordan Pickford
- Cody McDonald
- Joe Pigott