Havlat snapped a 15-game goal drought, Joe Pavelski scored just his second goal in 19 games and added a late assist, and James Sheppard wrapped it up with his first goal of the season with 9:56 to play in San Jose's final stop on a five-game trip.
Emerson Etem scored his second career goal and Francois Beauchemin also scored for the Ducks, who wrapped up a string of five home games in eight days with their first three-game skid of the season.
Corey Perry scored for Anaheim with 1:40 to play, but Dan Boyle scored on an empty net with 28 seconds left.
I have been blessed to play for 16 years in the NHL; it has been an amazing ride. I would like to thank the Tampa Bay Lightning and New York Rangers organizations and owners for providing me the opportunity to play the sport I love for so many years. I could have never played for so long or accomplished all that I have without the unwavering love and support from my wife, Heather, our three sons, Ryan, Lucas, and Mason, and my parents.
— Martin St. Louis after announcing his retirement from the NHL on Thursday