Di Canio celebrates his winner Photos from Upton Park

Paolo di Canio returned from his injury wilderness to grab a Premiership survival lifeline for West Ham at Upton Park.

Di Canio came on as a second-half substitute to snatch victory 19 minutes from time with his 50th goal for the club and ensure the Premiership relegation scrap goes to the final day of the season.

The brave Hammers knocked and knocked at the Chelsea door for 70 minutes but just could not find a way through before Di Canio's dramatic intervention.

The Italian pounced in the Chelsea penalty area after Trevor Sinclair had seen his shot blocked by Celestine Babayaro and his goal sent the Upton Park crowd into ecstasy.

Hammers' caretaker manager Trevor Brooking had gambled by deploying a three-man attack and recalling Paolo di Canio to the substitutes' bench.

Les Ferdinand completed a speedy recovery from a leg injury suffered at Manchester City to take his place alongside Freddie Kanoute and Jermain Defoe and the tactics looked shrewd as West Ham created chances from the start.

KEY MOMENTS 2 mins: Kanoute fluffs an early chance 25 mins: Sinclair volley brilliantly saved by Cudicini 71 mins: Sub Di Canio snatches West Ham winner 90 mins: Lampard shot saved by James

The Hammers were clearly fired up and were nearly in front after just 67 seconds, but Kanoute completely missed his kick from a low Trevor Sinclair cross and Defoe saw his follow-up shot saved by Carlo Cudicini.

Cudicini then produced a flying stop to brilliantly push Kanoute's header over the crossbar and further drew the sting out of West Ham's blistering opening spell when he parried a Sinclair volley midway through the half.

In between, Gianfranco Zola ensured it was not all one-way traffic as he sent a 20-yard shot just over the crossbar.

Former Hammer Frank Lampard, booed throughout by supporters who once cheered him, almost silenced the home crowd with a free header from a corner, only for Rufus Brevett to clear on the line.

But most of the pressure was at the other end, with Kanoute's aerial presence a constant threat to the Chelsea defence.

And when the French striker nodded into the side-netting early in the second half, half the Boleyn Ground began to prematurely celebrate, believing the ball had gone the other side of the post.

Brooking could hardly watch an agonising match

The mercurial Italian striker came on in place of the tiring Ferdinand, but victory remained tantalisingly out of West Ham's reach, with Steve Lomas forcing another fine save from the defiant Cudicini.

But Di Canio finally made the breakthrough with 19 minutes left with a cool finish to a scrambled move.

The goal gave West Ham something of a dilemma as they appeared unsure whether to defend their lead or go in search of a second.

Ultimately, it was not a hard decision to make, given that West Ham cannot defend.

Defoe shot across the face of goal from a narrow angle with 10 minutes left but Lampard nearly spoiled the party when his injury-time strike was saved by David James.

Defeat leaves Chelsea needing a draw against Liverpool on the final day of the season to secure a Champions League place.

At the same time, West Ham will be at Birmingham with survival within their reach.

West Ham: James, Johnson, Repka, Dailly, Brevett, Lomas, Cole, Sinclair, Kanoute, Les Ferdinand (Di Canio 56), Defoe. Subs not used: Van Der Gouw, Hutchison, Garcia, Cisse.

Booked: Sinclair, Defoe, Repka.

Chelsea: Cudicini, Melchiot, Gallas, Desailly, Babayaro, Morris (Zenden 77), Petit, Lampard, Le Saux, Gudjohnsen (Hasselbaink 72), Zola (Cole 72). Subs not used: de Goey, Stanic.

Booked: Morris.

Attendance: 35,042.

Referee: A D'Urso (Essex).