The Citizens were facing successive Premier League draws heading into added time at the Vitality Stadium, only for England international Sterling to net in the 97th minute.
Kompany insists that, while City did have to ride their luck on the south coast, his side did enough to deserve the three points on their travels.
Asked about the dramatic late winner, the Belgian defender told Sky Sports News: "[It was] madness. The first thing I did was say to Benjamin Mendy and Bernardo Silva, 'welcome to the Premier League'.
"I thought we played well, like we did against Everton. We did not score our chances but we have big, fast, strong players and anything can happen. We deserved to win, but they made it hard for us.
"Our strength of character showed and we dealt with the physical challenge well. Overall, we won 95% of our challenges, which is a good sign."
Kompany has put his previous injury issues to one side this season by featuring for the full 90 minutes in City's first three games.