Stock, who has endured injury problems in recent seasons, pounced from 12 yards in the fourth minute of added time - his first goal since March 2009 - to condemn Boro to a ninth away loss this term.
Middlesbrough, who have now taken just four points out of a possible 33 on their travels, made a flying start when Scott McDonald put them ahead inside four minutes but in-form striker James Hayter - with his sixth goal in his last eight - levelled in the 22nd minute.
O'Driscoll, whose side bounced back from last Saturday's 5-1 defeat at Leicester, said: "You have to feel a bit sorry for them for losing like that because they probably didn't deserve it on the night.
"Having said that their keeper (Jason Steele) made a fantastic save only moments before we scored and you do need a bit of luck to win in this division.
"It looked a bit ominous when we conceded after only four minutes and you wonder then whether the wheels might come off. But we always looked a threat and that was pleasing."
Doncaster fielded four centre-backs in defence because a spate of injuries and O'Driscoll added: "We had to mix and match because of the problems, but weve pulled rabbits out of the hat all season and that won't change."
Middlesbrough manager Tony Mowbray bemoaned his side's luck.
He said: "I thought in the last 20 minutes of the second half we were the only side that were going to win the game so we were absolutely gutted to lose like that.
"We missed a few chances, but I suppose at one point because of the way we played we wouldn't really have been content with the draw - but then we end up losing.
"We have a fantastic young keeper and I wouldn't blame him for the goal. He says it took a deflection on the way."
Mowbray added: "We can't feel sorry for ourselves, we just have to carry on battling as a team and keep working hard.
"oncaster are a well coached, well organised side and pleasing on the eye so on a positive note it was good to come here and play like we did.
"We could have scored a few goals and we are trying to build belief and confidence and ultimately a winning team.
"It seems it's going to take time, but all the players are desperate to do well."