Veteran midfielder McCann came off the substitutes' bench to convert two penalties in the space of seven second-half minutes and transform this clash as Peterborough moved clear of the bottom three.
Cardiff led courtesy of Aron Gunnarsson's 23rd-minute strike following a Don Cowie corner, but that changed following the introduction of Northern Ireland international McCann.
He was sent on as a 69th-minute replacement for Kane Ferdinand, levelled three minutes later after Mark Little had been tripped by Cowie and stepped up to beat Cardiff goalkeeper David Marshall again in the 79th minute after Dwight Gayle had been sent tumbling by Matt Connolly.
Posh, who saw at least three other strong penalty appeals turned down by referee Eddie Ilderton, had to survive a couple of late scares before jumping out of the relegation zone.
"I wouldn't want anyone else standing over a penalty," Ferguson said. "Grant has a terrific record and put them both away superbly. We could probably have had six penalties in all.
"We have beaten a team that is bound for the Premier League twice - and we have done it on merit on both occasions.
"Hopefully it turns out to be a big win for us. I'm not fussed about our league position because it is points that matter to me.
"March has always been a good month for us and that has certainly been the case again."