Selective hydrogenation of unsaturated carbonyl compounds plays a key role in the production of fine chemicals and pharmaceutical agents. In this work, two kinds of intermetallic compounds (IMCs: CoIn3 and CoGa3) were prepared via structural topotactic transformation from layered double hydroxide (LDH) precursors, which exhibited surprisingly high catalytic activity and selectivity toward hydrogenation reaction of α,β-unsaturated aldehydes (C═O vs C═C). Notably, the CoGa3 catalyst shows a hydrogenation selectivity of 96% from cinnamaldehyde (CAL) to cinnamyl alcohol (COL), significantly higher than CoIn3 (80%) and monometallic Co catalyst (42%). A combination study including XANES, XPS, and CO-IR spectra verifies electron transfer from Ga (or In) to Co, leading to the formation of Co—Ga (or Co—In) coordination. FT-IR measurements and DFT calculation studies substantiate that the electropositive element (Ga or In) in IMCs serves as an active site and facilitates the adsorption of polarized C═O, while C═C adsorption on the Co site is extremely depressed, which is responsible for the markedly enhanced selectivity toward hydrogenation of C═O. This work reveals the key role of functional group adsorption in determining the hydrogenation selectivity of α,β-unsaturated aldehydes, which gives an in-depth understanding on the structure–property correlation and reaction mechanism.