The Brazilian admitted that he had all but settled for second place behind his Ferrari team-mate until the Finn was forced to back off.
"It was fantastic - I didn't expect that," said Massa.
"Sometimes you need a little bit of luck, and today we had some luck due to what happened with Kimi's exhaust.
"It was a good present, for sure."
Raikkonen led by six seconds prior to his problems, and Massa conceded his team-mate had him covered until the exhaust glitch.
"I was quite comfortale in the second position, he had a very quick pace and I'm sure it would've been very, very difficult for me to pass him," he said.
"We had two laps difference in terms of fuel and I was always about 0.3s slower and you have to be on the same pace, maybe only one tenth slower, if you're going to beat him, and that was not the case.
"I saw he had a great pace, maybe a slightly better balanced car, and I did not want to take risks because second was already a great result."
In the closing stages Massa maintained his lead even when a rain shower briefly made the track treacherous.
He said he had been extra cautious when the rain fell because he knew he had a large lead to play with.
"It was very difficult because sometimes you could really feel the track was not the same," Massa said.
"Instead of taking risks I was really slowing more than I needed to because I had a very good gap, so I was not risking anything.
"In the end it was not raining heavily enough for us to think of changing tyres."
The result puts Massa into the championship lead for the first time in his Formula 1 career, and although Ferrari's main rival McLaren was held back by its drivers' grid penalties in France, Massa is confident that his team has regained the advantage.
"It was a great race, and we showed our performance here," he said.
"We don't really know about our competitors' performance but I think we're going in the right direction and the team did a fantastic job."