The visits on Monday night were the first that Hamas has permitted any member of Fatah, the party of Palestinian President Mahmoud Abbas, and comes as the two parties trade accusations over the treatment of detainees.
The Hamas-run interior ministry in the Gaza Strip said Fatah lawmaker Ashraf Jomaa visited several prisons, including Gaza Central Prison, accompanied by Hamas member Ismail Al-Ashqar.
Ashqar said Jomaa was able to meet with prisoners being held on criminal and security charges and "ensure that none of them are on hunger strike."
He said the visit was intended to "refute all the allegations and lies that are being spread by Fatah" as the rival factions accuse each other of mistreating detainees.
Fatah, which has not immediately confirmed the visit, has denied allegations by Hamas that it has abused members of the Islamist group being held in the West Bank, where Abbas' party maintains control.
Fatah in turn has accused Hamas of torturing its members in Gaza jails.
Hamas has controlled the Gaza Strip since 2007, a year after it won legislative elections, when it routed Fatah forces from the coastal enclave.