Kevan Hurst’s cool finish and Vincent Pericard’s double put the Cumbrians 3-0 up before Luke Chadwick’s brace and Sam Baldock’s strike levelled it for the Dons.
But Anyinsah’s 66th minute tap-in condemned Paul Ince’s men to their third straight defeat, while Tom Taiwo was shown a second yellow card in stoppage time for kicking the ball away.
Hurst collected Graham Kavanagh’s cut-back to fire home the opener in the fifth minute before his free-kick was headed in by Pericard to double the Cumbrians’ lead in the 17th minute.
Pericard then ghosted in unmarked to nod in his fourth goal of the season from Kavanagh’s free-kick three minutes later.
Chadwick started the Dons’ fightback with a precise snap-shot from the edge of the box in the 35th minute and then poked in from five yards a minute later to make it 3-2. Baldock outpaced Ian Harte to drill in an equaliser for the Dons two minutes after the break, but substitute Anyinsah slotted home Kavanagh’s corner from close range to win it for Carlisle.