The Scots trailed 24-21 with just 12 minutes remaining before Danielli and veteran Chris Paterson saved their blushes.
Paterson pulled Scotland level with a fourth penalty and then Danielli provided the finishing touches to a brace of impressive team moves to hand his side a 34-24 victory.
Earlier tries from scrum-half Mike Blair and centre Joe Ansbro had given Scotland an 15-3 lead inside the opening quarter and, despite shipping a score to Mihaita Lazar on the stroke of half-time, they led 18-11 at the break.
The prelude to the real drama arrived on 68 minutes when No8 Daniel Carpo broke off the back of a scrum to move the underdogs ahead.
But just when Scotland's chances of reaching a seventh straight World Cup quarter-final appeared to be in disarray just one game into the competition, Robinson's team produced their two best attacking moves of the match to allow Danielli to cross the whitewash first on 75 minutes and then again three minutes later.
The first of those scores saved Scotland from what would have been major embarrassment and the second secured what could be a vital bonus point.
Scotlandskipper Ali Kellock was keen to focus on the positives surrounding his side's fightback but even he admitted the overall performance wasn't up to scratch.
"Our finishing at times was outstanding and I thought our back three were outstanding - we didn't give them very much good ball," said Kellock.
"We were in a tough situation with about 10-15 minutes to go and, credit to us, we dug it out. But we are disappointed with some aspects of our game.
"We made a lot of errors in the middle 40 minutes and we've got to cut them out - simple things and simple things are generally easy to fix."
Scotlandnow face Georgia on Wednesday before taking on Argentina and then England in Pool B.