Gagner's goal came with 1:29 to play, but Henrik Sedin ended any doubt with an empty-net goal with 46 seconds remaining.
Sanford, backup goaltender to Roberto Luongo, made 22 saves.
Vancouver won its second straight and Edmonton has lost two in a row. Daniel Sedin's two goals raised his total for the season to 14.
Prior to the game, Vancouver retired the No. 16 worn by former captain Trevor Linden. He and Stan Smyl are the only two players in Canucks history to have their number retired.
Jordana Brewster on Paul Walker: 'He was an enormous presence in my life'
Beyonce flaunts bikini body, Blue Ivy in vacation pics