A man who attacked his neighbour, making him feel like a "frightened beaten dog" has been sentenced at court.