Sam Allardyce's men jumped five places in the Premier League table thanks to two late goals, although the Canaries had the better of the chances.
Both clubs were level on 25 points before kickoff, with West Ham 15th and Norwich 16th, and Collins grabbed what could be a crucial goal when he headed home Diame's cross with six minutes remaining.
The capital club's third straight 2-0 win in the Premier League — and a 13th clean sheet of the season, the division's best record — also moves it three points clear of the visitors, whose winless run was extended to four matches.
VIEW FROM UPTON PARK
By Liam Twomey
After what was billed as a relegation showdown, West Ham incredibly finds itself in the top half of the Premier League. James Collins and substitute Mohamed Diame gave Sam Allardyce a third consecutive victory that would not have been possible without several excellent saves from goalkeeper Adrian.
Norwich had the only moments of inspiration in his largely turgid affair — Gary Hooper and Robert Snodgrass both should have opened the scoring before Collins eventually did — but leaves Upton Park with another defeat that keeps it deep in relegation trouble and piles further pressure on Chris Hughton.
It is just one win in 11 Premier League matches for the Canaries now. Hughton has been maligned for his conservative approach and lived up to it here, starting with a five-man midfield and only bringing on a second striker when his side was already behind with time slipping away. He will consider himself unlucky after the chances his side produced, but that may not save him.
Substitute Diame then sealed the win by finishing off a swift counterattack in injury time as Norwich pushed for a equalizer.
Chris Hughton's side made a nervy start to the game but created the first meaningful chance 10 minutes in. Nathan Redmond turned Guy Demel inside out and crossed for Gary Hooper, whose header forced Adrian into a smart save.
Sebastien Bassong then made two important clearances for the visitors, before the creativity of Redmond unlocked the West Ham defense once again.
The 19-year-old winger’s ball over the top sent Snodgrass through on goal, but the Scot chose to shoot first time rather than take a touch and Adrian was able to make a comfortable save.
West Ham began to get more possession as the half progressed, but was unable to create a noteworthy opportunity despite sending a series of crosses into the Norwich box — largely thanks to some fine defending from Bassong.
Norwich threatened again just before the break as Alexander Tettey's strike from just inside the area was pushed round the post by the diving Adrian.
Marco Boriello was sent on at halftime, replacing the ineffective Carlton Cole, and the on-loan Roma striker was almost presented with an instant chance, but Norwich goalkeeper John Ruddy was alert to clear the danger.
West Ham winger Matt Jarvis then cleverly pulled the ball back for captain Kevin Nolan just before the hour, but the in-form midfielder got the ball caught up in his feet and a great chance went begging.
Hooper spurned a good opportunity for Norwich shortly after, before Diame's firm strike from inside the box was brilliantly tipped over by Ruddy.
But Ruddy could do nothing about Collins' 84th-minute opener, as he powered home his first Premier League goal since March 2012 from Diame's cross.
And Diame himself then put the game to bed with his third goal of the season in the 94th minute to move West Ham well clear of the relegation zone.