Newcastle signed Slimani from Premier League rivals Leicester on loan on January transfer deadline day.
The 29-year-old Algeria international striker will remain at the Magpies until the end of the season.
West Ham manager Moyes has revealed that he thought that he had signed Slimani, who joined Leicester from Sporting Lisbon in the summer of 2016 for a transfer fee reported by BBC Sport to be worth £29 million.
"Slimani was agreed on Tuesday night and it didn't come off on Wednesday. I only woke up on Wednesday to be told that it wasn't going to happen," Moyes told Sky Sports.
Slimani struggled to make an impact at Leicester this season, although there is no doubt that he is a quality striker with a lot of experience.
The Algerian would have been a good signing, especially on loan, and West Ham’s loss is Newcastle’s gain.
The signing of the 29-year-old striker has enhanced the Magpies’ chances of escaping the drop to the Championship at the end of the season.