The man shouted “this is for Syria” during the attack, the interior minister said. Prosecutors have opened a terrorism investigation.
The officer suffered minor injuries. The suspect was wounded in the chest when another policeman opened fire.
Tourists fled for cover as the attack unfolded. Hundreds of people were in the cathedral at the time.
France is in a state of emergency since attacks by jihadists in Paris killed 130 people in 2015.
The assailant on Tuesday afternoon carried kitchen knives and the identity card of an Algerian student, French Interior Minister Gérard Collomb said.
The man, who was being treated in hospital, has not been named.
As police declared the situation “under control”, hundreds of people were being allowed to leave the cathedral.
Kellyn Gorman, an American tourist, said: “I was about to come inside [the cathedral] and heard the noise, the gunshots, turned around and saw the assailant on the ground where they had shot him.”
“It was very safe, very quickly contained.”
Notre-Dame is one of the most visited tourist sites in Paris. Last year, police foiled an attack near the site.
The incident comes just three days after militants used a van and knives in an attack in London which left seven dead.