A court may order pendente lite relief consisting of a custody or visitation order pursuant to Part 2 (commencing with Section 3020) of Division 8, if the court finds both of the following:
(a) A parent and child relationship exists pursuant to Section 7540 or 7541.
(b) The custody or visitation order would be in the best interest of the child.