The Hammers had trailed to Alexander Isak's early penalty but goals from Michail Antonio, Mohammed Kudus and Jarrod Bowen but the visitors firmly in command on Tyneside.
With 12 minutes left, another Isak spot-kick gave United a lifeline but the game really turned on the introduction of Harvey Barnes, who rolled home the leveller after Isak's perfect through ball.
And Barnes' winner - a wonderful curling effort from the edge of the box - sparked jubilant scenes at St. James', and there were some brilliant photos to come from the stunning late comeback. Serena Taylor, assisted by Harriet Massey and Michelle Mercer, brought nufc.co.uk this gallery from a memorable day on Tyneside.