Captain Tommy Rowe was the hero with a late winner as Posh sank the bottom-placed Tykes in a tense basement battle at London Road.
Marlon Harewood cancelled out Michael Bostwick's opener in controversial fashion, but Rowe beat three men and fired past goalkeeper Luke Steele with three minutes to go to ensure the equaliser was not the major talking point.
Ferguson said: "Tommy popped up with a fantastic goal at a great time to earn us an important result.
"Getting out of the bottom three is a big psychological boost, but my main focus is always on points.
"We're up to 25 after a great run of results at a crucial time in the season but we still need eight more wins to be safe."
The Posh boss continued: "That is a big ask but I've seen a hell of a lot of good things from my players lately.
"They have played terrific football to pick up results recently and then dug really deep despite being pushed back for much of the second half."