Manager Sam Allardyce organised the game to get players up to fitness and among those appearing were Alex Song, Sakho and captain for the day Diego Poyet.
Academy scholars including Amos Nasha, Nathan Mavila and Lewis Page also had run outs.
Ravel Morrison, Song and Poyet dictated the game according to the report on the official site at www.whufc.com.
Fanimo grabbed the first after 12 minutes cutting in from the left before firing into the far corner.
It was not long before West Ham doubled their lead. Mavila was awarded a penalty, having been clipped in the box, but saw his effort saved although Fanimo was on hand to nod in the rebound.
Fanimo completed his hat-trick after a Song pass had split the Tractor Boys defence.
Sakho was a serious physical menace throughout and scored the fourth of the five finishing off a a stunning move involving Song and Morrison.
The Hammers tied things up when Morrison played in Fanimo for yet another calm finish.