Rovers scored three goals in 11 first half minutes through Andy Butler, Liam Mandeville and Matty Blair to take control at the Lamex Stadium.
But they were left holding on at the death for a fourth successive league win as Boro recovered after the break to make it 3-2 and then 4-3 following a header from John Marquis.
“The result is the main thing,” said Ferguson after the game.
“It’s a great result at a really tough place to come against a team that never lie down, as we saw in the second half.
“The first half was good. They didn’t really trouble us at all and we scored three really good goals.
“We asked for a professional performance, and to try and control the game, in the second half but you have to credit the opposition because I thought they were outstanding in the second half.
“To lose 3-1 in 45 minutes doesn’t make me happy but the result does and certain things do.
“It’s a really disappointed dressing room. We’ve gone top of the league today and it shouldn’t be like that.
“We have to look at in on Monday in terms of the goals we lost. The manner of the goals we lost were very disappointing.”