The visitors started well and went close in the second minute when Luke Murphy fired wide after good work from Ashley Westwood.
And Crewe felt they should have had a penalty after 15 minutes when Matt Tootle went down in a challenge with Bees goalkeeper Jake Cole, only to be booked for diving.
They finally took the lead after 28 minutes when Barnet defender Calum Butcher slipped to allow Joel Grant in to slot home.
But five minutes from the break Dean Sinclair slid in to divert Albert Jarrett's low cross beyond Steve Phillips for his first goal since returning to Barnet on loan from Charlton.
Barnet had chances early in the second half with Craig McAllister seeing a header saved by Phillips before John O'Flynn shot wide when clean through. And the hosts were made to pay after 67 minutes when Donaldson raced through to chip beyond Cole and win it for the Railwaymen.