One officer was wounded in the neck and the other in the hand, according to a police spokeswoman who described their injuries as light.
Police launched a major search in the Old City and surrounding areas for the attacker, who fled, she said.
Annexed east Jerusalem, including the Old City, has been shaken by frequent clashes between Israeli police and Palestinians in recent months, as well as a series of "lone wolf" attacks on Israeli civilians.