Crewe winger Billy Waters scored for the second time in a week against the Reds to put the home side ahead against the run of play in the 22nd-minute.
But second-half efforts from Leroy Lita and Cranie earned Danny Wilson's team their first win of the campaign.
Waters, 19, blasted a stunning far-post volley past visiting goalkeeper Adam Davies after Manchester City loanee Greg Leigh had floated over a teasing cross.
Barnsley had been the better side up to then, but lacked a cutting edge.
Sam Winnall was convinced he had given the South Yorkshire outfit a first-minute lead, but his thumping header applied to Keith Treacey's delivery was palmed over by home goalkeeper Scott Shearer.
Winnall proved to be the thorn in Crewe's side when Barnsley levelled in the 57th-minute as he skipped clear down the right to send over a deflected cross which evaded Shearer and allowed Lita an easy tap-in.
The well-travelled forward appeared inspired after that and went close to scoring a second with an acrobatic scissor kick which arrowed only a couple of yards wide.
But Barnsley secured maximum points with 15 minutes left when Cranie won the aerial battle after Lewin Nyatanga had headed on Conor Hourihane's corner and directed his effort under the crossbar.