In three dimensions, we consider a particular truncation of the Horndeski action that reduces to the Einstein-Hilbert Lagrangian with a cosmological constant $\mathrm{\ensuremath{\Lambda}}$ and a scalar field whose dynamics is governed by its usual kinetic term together with a nonminimal kinetic coupling. Requiring the radial component of the conserved current to vanish, the solution turns out to be the BTZ black hole geometry with a radial scalar field well defined at the horizon. This means in particular that the stress tensor associated to the matter source behaves on shell as an effective cosmological constant term. We construct a Euclidean action whose field equations are consistent with the original ones and such that the constraint on the radial component of the conserved current also appears as a field equation. With the help of this Euclidean action, we derive the mass and the entropy of the solution, and find that they are proportional to the thermodynamical quantities of the BTZ solution by an overall factor that depends on the cosmological constant. The reality condition and the positivity of the mass impose the cosmological constant to be bounded from above as $\mathrm{\ensuremath{\Lambda}}\ensuremath{\le}\ensuremath{-}\frac{1}{{l}^{2}}$ where the limiting case $\mathrm{\ensuremath{\Lambda}}=\ensuremath{-}\frac{1}{{l}^{2}}$ reduces to the BTZ solution with a vanishing scalar field. Exploiting a scaling symmetry of the reduced action, we also obtain the usual three-dimensional Smarr formula. In the last section, we extend all these results in higher dimensions where the metric turns out to be the Schwarzschild--anti--de Sitter spacetime with planar horizon.