Hearts started strongly, but a defensive mistake allowed Chris Duggan through for the visitors. However, the striker failed to capitalise, sending his volley just wide.
Duggan continued to threaten for Dumbarton, angling a shot to the near post which forced a save from Neil Alexander.
Jamie Walker nearly opened the scoring after Sow sent him through, but his shot struck the side-netting.
After the break, Sow broke the deadlock with his 11th of the season following Sam Nicholson's corner.
Shortly after the hour mark, Wilson doubled Hearts' lead with a header, finding the top corner following King's corner.
King wrapped up victory with two late goals, with the first a solo effort, taking on several defenders before rolling the ball into the net.