In 2367 (TNG "The Wounded"), Captain Benjamin Maxwell took the the Phoenix into Cardassian territory to attack supply ships and bases that he believed to be preparing for a new war against the Federation. The USS Enterprise, commanded by Captain Jean-Luc Picard, entered Cardassian space with Cardassian advisors aboard to search for the Phoenix. During the pursuit, the Phoenix destroyed another Cardassian transport and a Cardassian warship. The Enterprise intercepted the Phoenix, and Picard ordered Maxwell to return his ship to Federation space under escort by the Enterprise.
Maxwell broke formation, however, to intercept another Cardassian transport, attempting to convince Picard to board it and search it for war supplies. Picard refused, and a battle between the two Federation ships was only prevented by the intervention of Chief Miles O'Brien, who was able to transport himself aboard the Phoenix and convince Maxwell -- his former commander -- to surrender. Maxwell was confined, and the Phoenix followed the Enterprise back to Federation space under the command if its first officer.
Prior to its battle with the Cardassian warship, Picard ordered Lieutenant Worf to transmit the prefix code of the Phoenix to the Cardassian ship. This would presumably allow the Cardassians to transmit remote commands to the Phoenix, such as an order to lower shields (as seen in ST2).
Cardassian possession of the Phoenix's prefix code had no apparent effect on the battle, however, as the Phoenix survived the initial Cardassian attack with no noticeable damage, and the Phoenix's return fire destroyed the Cardassian ship in one torpedo salvo. It isn't clear whether the Cardassians didn't take advantage of the code, the crew of the Phoenix had changed the ship's prefix code at some time before the encounter, or the crew of the Phoenix (more experienced than Khan's followers) simply overrode the remote command.
Miles O'Brien was able to transport onto the Phoenix by exploiting Starfleet operating protocols. The Phoenix was using an active sensor sweep that required the ship's shields to "blink" at predictable intervals, and he was able to time his transport to coincide with one of the sweeps.