Walking up the directory path
f=/home/bu5hman/test; file=${f##*/}; base=${f%/*}
while [ ! -z $base ]; do
find $base -maxdepth 1 -name $file
base=${base%/*}
done
By strict depth only
find / -iname test -exec sh -c 'd=${1//[^\/]}; echo ${#d} $1' sh {} \; 2>/dev/null | sort -n -r | cut -d" " -f2-