The first observation of the $B_s^0 to overline{D}^0 K^+ K^-$ decay is reported, together with the most precise branching fraction measurement of the mode $B^0 to overline{D}^0 K^+ K^-$. The results are obtained from an analysis of $pp$ collision data corresponding to an integrated luminosity of $3.0~textrm{fb}^{-1}$. The data were collected with the LHCb detector at centre-of-mass energies of $7$ and $8$ TeV. The branching fraction of the $B^0 to overline{D}^0 K^+ K^-$ decay is measured relative to that of the decay $B^0 to overline{D}^0 pi^+ pi^-$ to be $$frac{mathcal{B}(B^0 to overline{D}^0 K^+ K^-)}{mathcal{B}(B^0 to overline{D}^0 pi^+ pi^-)} = (6.9 pm 0.4 pm 0.3)%,$$ where the first uncertainty is statistical and the second is systematic. The measured branching fraction of the $B_s^0 to overline{D}^0 K^+ K^-$ decay mode relative to that of the corresponding $B^0$ decay is $$frac{mathcal{B}(B_s^0 to overline{D}^0 K^+ K^-)}{mathcal{B}(B^0 to overline{D}^0 K^+ K^-)} = (93.0 pm 8.9 pm 6.9)%.$$ Using the known branching fraction of ${B^0 to overline{D}^0 pi^+ pi^-}$, the values of ${{mathcal B}(B^0 to overline{D}^0 K^+ K^- )=(6.1 pm 0.4 pm 0.3 pm 0.3) times 10^{-5}}$, and ${{cal B}(B_s^0 to overline{D}^0 K^+ K^-)=}$ $(5.7 pm 0.5 pm 0.4 pm 0.5) times 10^{-5}$ are obtained, where the third uncertainties arise from the branching fraction of the decay modes ${B^0 to overline{D}^0 pi^+ pi^-}$ and $B^0 to overline{D}^0 K^+ K^-$, respectively.