The Frenchman looked well set for a strong result from fourth on the grid, and he even edged alongside eventual winner Lewis Hamilton on the first lap before being forced to back off.
The AlphaTauri mechanics first spotted a water leak before the start, and they hoped they had been able to fix it after some urgent work on the grid.
Gasly got off the line well and had a look to the right of Hamilton, who made a bad start. However, as the gap to the grass closed he had to lift, and lost a place to Daniel Ricciardo.
After just eight laps, Gasly received an urgent radio message about a "terminal situation", and he was subsequently told "there is no option, if we don't retire now, we will blow everything up".
He thus had to pit and retire the car from fifth place, in order to protect the Honda power unit. His teammate Daniil Kvyat eventually finished fourth.
"That one is quite hard, especially for our home race here in Imola," said Gasly. "All weekend was going so well until now.
"Very sad to retire, but the guys spotted a drop of water pressure already on the laps to the grid, so they tried everything on the grid to fix it. And unfortunately it didn't work out, which meant we had to retire after a couple of laps.
"You always hope for the best. I had a great start, the reaction time was really good. I tried to go alongside Lewis, but I decided it was too close, quite hard, and I had to back out from it.
"After that we were running in P5. The car was so fast so all weekend, I felt good behind Daniel, I think we had slightly more pace than them. I think there was clearly a top five to fight for.
"On such a weekend for our home race it feels quite hard. But that's motorsport, unfortunately."
Team boss Franz Tost said that the crew believed that the issue had been resolved before the race got underway.
"They thought it's been sorted out," said Tost. "But there is a small broken part in there, and it's gone, unfortunately.
"We observed after four or five race laps that the water pressure decreased, and then we decided to bring him in, because we didn't want to risk the power unit. It was a welded line on the radiator which broke.
"It was a fantastic weekend for him. He did yesterday a really good qualifying, finishing in the fourth position. He had today a fantastic start, was on the side of Hamilton, and Hamilton pushed him to the right, he had to lift.
"Nevertheless he came back in the first lap in fifth position. And I must say a fantastic job from his side.
"We had just a meeting now, the race debrief, and of course he is very disappointed as we all are disappointed, because he could have scored a good number of points."