Di Matteo: Chelsea deserved win for persistence
The European Champions and Shakhtar were drawing 2-2 at Stamford Bridge with just seconds remaining before substitute Victor Moses thundered in a header from a corner.
"I think in terms of the timing of the goal you could agree there was an element of luck because it was the last action of the game but when you get a win against such a good team as them you deserve it," Di Matteo told a news conference.
"We did a lot of good things and put them under pressure, especially in the first half, which produced our two goals for Fernando Torres and Oscar. We got those goals with high pressure on the goalkeeper.
"It was a game we needed to win and we achieved that under a lot of pressure. We need to get something out of our last games now."
Chelsea, who nest play away at Juventus, have seven points from four Group E matches, the same as Shakhtar. Juve are on six and Nordsjaelland on one.
Di Matteo added: "It was always going to be a hard match. They are a very good side and they have lots of good individual players and they play well as a team. Certainly because we went ahead twice and lost the lead and we need to work on these things."
Explaining why club skipper John Terry was left on the bench, even though he was eligible to play, he said: "JT is a fantastic player for this club for our team.
"He's got many qualities and I'm very happy he's back available for us and considering the last four weeks with the pressure of life - I thought I needed players who were 100 percent match fit for a game like this but I'm very happy he's back with us and available."
Terry has missed four domestic matches because of suspension, and Di Matteo continued: "It's not easy to tell a player he's not starting a game."
Shakhtar coach Mircea Lucescu, the last coach to win a group match at Chelsea when his Besiktas team won at Stamford Bridge in 2003, rued the loss.
"What can I say? I think we had a lot of the ball and we played better than them.
"We had much better organisation in all our attacks. We had possibilities to score more. It was a pity in the last minutes we did not take opportunities. We left some spaces behind. It was a big mistake the third goal and it's painful to lose like that."
He also regretted the mistakes made by his goalkeeper Andriy Pyatov.
"Yes, we have two matches to play and I still think we can qualify for the last 16, but it would have been much easier with a point. It was a pity that today we unfortunately had a goalkeeper who made some mistakes and that cost us.
"He knew what to do on the last goal...He knew very well what I asked him to do before the game. I told him to stay within the six metres.
"He forgot at the last moment. I am very angry it was a lack of concentration and lack of experience, something went there."