Sporting CP led Real Madrid until the 89th minute but lost, and Alvaro Morata admitted justice is not always done in football.
Sporting had the better of the first half and took the lead two minutes after the restart, Bruno Cesar bending an excellent finish beyond Kiko Casilla.
However, the Portuguese side were denied a first win at the Santiago Bernabeu when Cristiano Ronaldo fired a free-kick into the top-right corner in the 89th minute.
Morata, who came on as a replacement for Karim Benzema in the second half, then snatched the win for the defending champions in the fourth minute of additional time.
The Spain international acknowledged sometimes football is not fair, but he was pleased to have ended up on the winning side.
"Sometimes football is not just. Today, I do not know if it was right, but it was important to win and we succeeded. We are trying to be first in the group," he said in a post-match interview.
"We did not start the match well, but this is Madrid and in this club and on this stage these things happen.
"I'm really happy at home. We always had faith until the referee blew the final whistle."
Having been dropped after the 5-2 victory against Osasuna at the weekend, Morata was pleased to have got the winner on Wednesday and is enjoying being back at the Bernabeu.
"I knew James [Rodriguez] was going to put the ball in there and I gave everything to get it as it came in," he said.
"It is clear that my dream is to win here. I'm working well and will hopefully help with goals."