It was a lacklustre start from the hosts as they struggled to create goalscoring chances, with the visitors seeing more of the ball in the early stages.
Christopher Buchtmann tried to put St Pauli ahead by unleashing a shot from inside the box, but it was blocked, and a few minutes later the away side squandered an opportunity.
A free kick from a decent area was lifted into the box to find Sami Allagui, who latched on for a free header, but the forward moved marginally offside when the whistle blow.
St Pauli continued to probe and came close to breaking the deadlock when Bernd Nehrig shot from close range after getting on the end of a corner kick, only for his effort to be saved by the goalkeeper.
With the clock running down, Sandhausen had more joy in attacking areas and almost went a goal to the good when Klingmann whipped a ball into the side-netting.
Against the run of play, the hosts took the lead when Stiefler picked the ball up on the edge of the box after his team's corner was cleared and delivered it into the bottom right corner.
St Pauli tried to respond, and they were eventually rewarded when Jan-Marc Schneider turned in the middle of the box before thumping the ball into the net in the 88th minute, scoring his first ever goal for the club.
Both clubs have 18 points, which leaves them three points adrift of the top four.body check tags ::