The episode script indicates that Data was largely successful in infiltrating the Borg shared consciousness (via Picard's own neural link to the Borg machinery in his brain). When he did so, he triggered Picard to 'reach out', allowing Picard to make regain some measure of individuality.
BEVERLY: Data, I'm picking up increased neural activity in Captain Picard... localized in the prefrontal and parietal lobes...
...
And it is only by sheer force of will, the power of the man, that Picard is able to reach through the control of the Borg consciousness... and whisper this word...
You may wish to note that it's explicitly stated in First Contact (the film, not the TNG episode) that Picard's assimilation was unique. The Borg Queen didn't want just another puppet drone, she was looking for him to maintain an individual personality, albeit pliant. Had his assimilation been standard and complete, it's likely that Data and Picard would have been unsuccessful in allowing him to regain his individual consciousness in the time allotted.
PICARD: You're lying. You wanted more than just another Borg drone. You wanted a human being with a mind of his own, who could bridge the gulf between humanity and the Borg. You wanted a counterpart, but I resisted. I fought you.