Writing a non-recursive DFS is possible by using your own stack, but I find the recursive solution to be more elegant. Here is a sketch of one:
DFS(vertex)
path.push_back(vertex)
visited[vertex] = true
if we found the exit
output path
else
for each neighbor v of vertex
if not visited[v]
DFS(v)
visited[vertex] = false
path.pop_back()