Dundee came from behind twice to deny Dundee United victory on their Scottish Premiership return in a frantic derby.