Jarrod Bowen is West Ham's top scorer with nine goals across all competitions this season
Cristian Romero's early header had given Spurs a deserved opener in the 11th minute as the defender nodded in Pedro Porro's corner with a looping effort.
But Jarrod Bowen hit back for the Hammers, latching on to a loose ball in the penalty area and firing in a 52nd-minute equaliser.
And, after a poor backpass from Spurs defender Destiny Udogie, James Ward-Prowse side-footed an effort against the post before knocking in the rebound to complete West Ham's turnaround in the 74th minute.
"I think it is a huge win to come here and win against this side," Moyes told BBC Radio 5 Live.
"I'm pleased with how we were resilient and diligent in our work, organised, defensively structured and we were always a threat as well."
West Ham have won five of their past six fixtures across all competitions while Tottenham suffered their fourth defeat in five and have dropped points from a winning position for a fifth consecutive game.
-- Courtesy of BBC Sport