If she doesn't have guardianship, just go get her. That is, unless your rights were terminated. I suggest consulting with a local attorney to discuss your specific facts asap to avoid a lengthy custody battle in NY.
I would consult with a family law attorney in New York as it is the state with home state jurisdiction since your daughter has lived there for the past 6 months. Under this fact scenario in Pennsylvania your rights as a parent would be weighed more heavily than the grandmother's rights to custody however the determination of custody would still be based on 16 factors that would be considered to determine what custody arrangement is in the best interests of the child. I would not go to New York and take your daughter as there is already an action pending in the New York state courts and they may view your actions as self help which could backfire on you.
You will likely end up in a custody battle with grandmother in New York. If the child has resided there for more than 6 months, New York is the proper jurisdiction to litigate the issue. In Pennsylvania, parents rights are superior to third parties, including grandparents. Even so, the Court will likely look at the overall best interests of the child in awarding custody.
Sign up to receive a 3-part series of useful information and advice about child custody law.