Giants captain Toby Greene produced a huge final term as the visitors came from three kicks down to emerge 11.11 (77) to 11.8 (74) winners at a rainy MCG on Sunday.
Skipper Greene was inspirational with 23 disposals, five clearances and three goals as midfield star Tom Green returned from injury with a bang, tallying 35 disposals and nine clearances.
Finn Callaghan (31 touches) and Stephen Coniglio (three goals) were also influential, but it was Keeffe who was the hero in the final minute.
After being beaten by Melbourne ruck star Max Gawn, Keeffe rolled the dice late in the match and pushed forward to mark 40 metres from goal.
His set shot sailed through to put the Giants in front for the first time since early in the third quarter.
It was a second win from as many games for GWS, who destroyed Collingwood in their season opener and are expected to be in flag contention this season.
Melbourne's season-opening heartbreak came despite a strong return from Christian Petracca, who had 27 disposals and two goals in his first game since suffering serious internal injuries midway through last year.
Clayton Oliver (25 disposals) and Jack Viney (27) were also strong performers in a reunited midfield with Gawn, who had 46 hit-outs and six clearances.
Melbourne suffered a blow before the first bounce when star defender Steven May withdrew because of a fractured larynx following a training mishap.
Despite the setback, first-gamer Matthew Jefferson gave the Demons a perfect start with the opening goal after just 17 seconds.
The Giants responded with the next three majors and took a five-point lead to the first break.
Two Petracca goals in the second term put the home side in front but the Giants regained the ascendancy before halftime with three goals in time-on.
They held a seven-point advantage at the end of a tight first half, during which the Giants' efficiency counteracted Melbourne's strength in the contest.
Petracca had a hand in both passages of play as the Demons reclaimed the lead with two long goals out of centre clearances in the opening 90 seconds of the third quarter, through Caleb Windsor and Tom Sparrow.
They piled on five goals to two for the term, turning for home 11 points in front.
But they couldn't deny the Giants, who kicked the final two goals through Greene and Keeffe to pinch a thriller.