The dog, a six-year-old shiba inu, took on the metre-high (three-feet) 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 550 kilometres north of Tokyo, a local police spokesman said.
"The boy suffered slight bruises and was taken to hospital but he was released on the same day," the spokesman said.
Local media identified the dog as a six-year-old bitch named "Mego" ("Cute").
More From This Section
"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.