You can log PIC time because you are "the sole manipulator of the controls of an aircraft for which the pilot is rated" (14 CFR 61.51). That's all that is required in this case for the pilot to log PIC time.
So since a pilot must be night current in order to fly with passengers, (61.57(b)) the question becomes, "is a flight instructor considered a passenger if they are providing instruction"?
AOPA has a flight briefing about this specific scenario where they quote FAA legal interpretations as saying:
"We agree that, for purposes of section 61.57(b), an authorized
instructor providing instruction in an aircraft is not considered a
passenger with respect to the person receiving instruction, even where
the person receiving the instruction is acting as [pilot in command].
(The instructor must be current, qualified to instruct, and hold a
category, class, and type rating in the aircraft, if a class and type
rating is required.) The instructor is not a passenger because he is
present specifically to train the person receiving instruction.
Neither is the person receiving instruction a passenger with respect
to the instructor. This training may take place, even though neither
pilot has met the 61.57(b) requirements."
Note that they say in this case, since neither of them is a passenger, that technically neither the pilot or the flight instructor has to be night current.