Marchessault kept the 3-on-1 play alive and eventually jammed the puck past San Jose backup goaltender Aaron Dell.
Will Karlsson scored twice, and James Neal and Shea Theodore also scored for the Knights.
The Knights (14-6-1) let a 4-1 second-period lead slip away when the Sharks rallied with goals from Brent Burns, Chris Tierney and Mikkel Boedker.