The dog, a six-year-old shiba inu, took on the metre-high bear after it attacked the young boy during a riverside walk with his great-grandfather.
The dog barked "unusually loud" and chased off the animal on Saturday evening in Odate, some 550km north of Tokyo, a local police spokesperson said.
"The boy suffered slight bruises and was taken to hospital but he was released on the same day", the spokesman said.
The boy's 80-year-old great-grandfather, who was a short distance away near his car, raised the alarm.
Local media identified the dog as a six-year-old dog named "Mego”.
"Mego is usually calm and timid. It was a great surprise that she chased away a bear", the dog's owner told the Sports Hochi daily.
"Mego has always been his friend and we have rewarded her with meat and other treats."
The Sports Hochi reported that the boy's clothes were torn and his back and bottom were covered in scratches where the bear had apparently clawed at him.
Asian black bears are native to large parts of Japan, including the main island of Japan, while brown bears roam Hokkaido further north.