Raffi Torres had two goals for the Canucks (2-5), who finish the preseason at Anaheim on Friday. Eddie Lack stopped 24 shots.
Heatley has scored in all four exhibition games in which he has played.
Lilja, a defenseman who helped the Detroit Red Wings win a Stanley Cup when San Jose coach Todd McLellan was on the staff, scored his first goal for the Sharks.
Torres put the Canucks on the board first, scoring midway through the first period.
Pavelski's power-play goal two minutes later evened the score and Couture's power-play goal with just under five minutes left in the initial period put San Jose ahead to stay.
Sharks F Jamal Mayers, who left Tuesday night's game early, was scratched. ... The Sharks assigned D Nick Petrecki and RW Cam McIntyre to Worcester of the AHL. ... The Canucks need a win Friday to avoid their worst preseason record in nine years. They were unbeaten in 16 combined exhibition games in 2008-09.
Copyright by STATS LLC and The Associated Press
Arena: HP Pavilion Location: San Jose, California
Referees: Francois St. Laurent, Tom Kowal Linesmen: Brad Lazarowich, Mike Cvik
Attendance: 16,106 (92.1% full)
Raffi Torres 2 Assist: Dan Hamhuis
Joe Pavelski 1 (power play) Assist: Logan Couture, Devin Setoguchi
Logan Couture 1 (power play) Assist: Ryane Clowe, Andreas Lilja