Joachim Low's men were held to a stalemate over 90 minutes by the spirited African side, who went close to scoring on a number of occasions only to be denied by a fine performance from Manuel Neuer.
|WORLD CUP SOCIAL HUB
|Keep up with all the latest news from Brazil and get involved in the debate on Twitter with our new World Cup Social Hub|
The Chelsea man believes that his team-mates' profligacy nearly cost them and, though he insists that his backwards flick goal was no fluke, accepts that he had a large slice of fortune.
"Obviously we wanted to win the match earlier," he told ZDF, "but Algeria did well, they pressured us from the beginning.
"I scored almost the exact same goal in Mainz three weeks ago so I am capable of it but, of course, I had a little luck.
"We had many chances in the last 10 minutes of the 90 but we missed them. Now we are at the quarter-finals. We need to relax and then play France."
Germany will face France in the quarter-final on Friday, with the winner facing either Brazil or Colombia in the last four.