City were heading for a frustrating evening at the Etihad Stadium on Monday until Kompany let fly with a 25-yard shot into the top corner 20 minutes from time -- the centre-back's first City goal from outside the box.
Victory saw City go top by a point from Liverpool heading into Sunday's last round of league matches.
"I hadn't scored this season but I always feel in big moments that I'm going to do something," Kompany told Sky Sports.
"Today was a little bit of frustration, everyone was saying 'don't shoot, don't shoot' and I could really hear it; I thought hold on a second, I've not come this far in my career for young players to tell me if I can take a shot, and I just had a go!"
The Belgian last hit the target from outside the area back in 2007 but Kompany insisted: "I've scored goals like that in training!
"It's 15 years I've been in top-level football, midfielders telling me 'don't shoot, play the ball wide' and every time they miss, for 15 years I've been saying 'I promise you, one day I'm going to have a shot from outside the box and I'm going to score a goal and you're going to be really happy with that one'."
- 'Big believer' -
City manager Pep Guardiola admitted he too was among those who didn't want Kompany to let fly from distance.
"Don't shoot! Pass the ball, pass the ball!," said Guardiola when asked about his thoughts as Kompany took aim.
"Honestly, I wasn't too confident but football is mad for that. The artists are the players, they have to decide things in a fraction of a second and what's important isn't the goal, it's him shooting while believing he was going to score.
"He's a big believer and that helped us to win the game," the former Barcelona and Bayern Munich boss added.
The 33-year-old Kompany's career has been blighted by injuries, with Guardiola saying: "He's not young and to be consistent is difficult for him every three days, but when we have a game once every week, he's an incredible player."
City will be assured of retaining the title if their result away to Brighton is equal or better to what Liverpool achieve against Wolves at Anfield on Sunday.
However, a win for Liverpool and anything less for City would see the Reds secure their first English championship since they last won the old First Division title in 1990.
And Kompany warned: "It's a big goal, we've not achieved anything (yet)."
But Leicester goalkeeper Kasper Schmeichel, who made several fine saves on Monday, said: "City are a top-class side, and we have lost to the potential champions.
"I can't see them losing their next game."