Mark Robins' Barnsley appeared to be on course for their first win in eight league games away from Oakwell as they defended a slender lead given to them by Marlon Harewood in the 22nd minute.
Tykes midfielder Nathan Doyle's shot was blocked by Kevin Thomson and from Kieran Trippier's subsequent corner the ball fell to Harewood six yards out and the on-loan Blackpool striker converted into the bottom corner.
But Republic of Ireland defender McShane was sent off by referee Chris Sarginson for violent conduct in the 69th minute and Boro capitalised.
McDonald headed home his 11th goal of the season with six minutes left.
Source: PA
Source: PA