Simons had earlier blazed over after skipping past Matt Doherty, while Jose Sa produced a sharp save to deny Rodrigo Bentancur.
The breakthrough finally came seven minutes from time when Palhinha prodded home from close range. Spurs were then rescued in stoppage time by goalkeeper Antonin Kinsky, who produced a superb last-gasp stop from Joao Gomes.
At the London Stadium, Callum Wilson climbed off the bench to deliver a stoppage-time winner that could prove priceless in the survival race.
Tomas Soucek had put the hosts ahead before Kiernan Dewsbury-Hall levelled with two minutes of normal time remaining, a goal that briefly threatened to drag the Hammers back into the drop zone.
Wilson had the final say, slotting home coolly after coming on in the 81st minute to keep his side two points clear of danger.
While at Anfield, Liverpool FC strengthened their hold on a Champions League place with a victory over Crystal Palace.