HSV kept their promotion hopes alive with a 4-3 win over St. Pauli in a highly dramatic Hamburg derby encounter.