Vincent Kompany stepped up as captain when Manchester City needed him as the centre-back scored from outside the area to secure the points in a game City had to dig deep to win.