Police spokeswoman Luba Samri said the "female terrorist" stabbed an Israeli man from behind in his upper body, lightly wounding him. The man drew his gun and fired, wounding her seriously, Samri said.
Both have been taken to a hospital.
Israel's Channel 2 TV said the attack took place near the site where a Palestinian stabbed an Israeli man to death and wounded his wife and toddler on Saturday. That assailant then attacked and killed another Israeli man before he was shot dead by police.
The ban did not apply to Palestinians who live, work and study within the Old City, or Israelis or tourists.
The move was imposed after a series of Palestinian attacks that killed several Israeli civilians.
Israel beefed up its forces in Jerusalem and the West Bank since the current unrest began about three weeks ago, and Prime Minister Benjamin Netanyahu is under intense domestic pressure to do more.
Four Israelis were killed last week in shooting and stabbing attacks in Jerusalem and the West Bank, while Israeli forces have killed four Palestinians, including a 13-year-old boy, amid violent protests.
Another measure banning men under the age of 50 from entering the Al-Aqsa mosque compound for prayers was also lifted. Israel has imposed the ban at times of unrest in the past as it is mostly young Palestinian men who take part in the violence.
That site has been at the heart of the recent tensions. The hilltop compound is revered by Muslims as the spot where the Prophet Muhammad ascended to heaven and by Jews as the site of the two Jewish biblical Temples.
