All cetaceans are classified as "even-toed ungulates" (Order: Artiodactyla), while horses are "odd-toed ungulates" (Order: Perissodactyla).
That means a giraffe is more closely related to a narwhal (58 MYA) than to a zebra (76 MYA).
(diagram by K. L. Mariott)