Macclesfield manager Mark Yates, whose side are bottom of the Football League, said the loss was “not what we needed”.
The Hammers gave debuts to three academy graduates, including Grady Diangana who scored twice.
Robert Snodgrass scored in either half, his first goals for the club since joining in January 2017.
Michail Antonio struck his first goal since March whereas Ryan Fredericks hit a spectacular second-half strike.
Get this video highlight on your device HERE or Stream Below;