A 35-year-old actress who has starred in off-Broadway shows and played bit parts on TV allegedly tried to push a fellow straphanger into the path of a subway train at Union Square over the weekend, law enforcement sources told The Post.

Keira Keeley’s random target was 57-year-old Leonore Gonzalez of the Bronx, who was waiting on the 4, 5 and 6 train platform. Keeley allegedly walked up and shoved her from behind at 12:15 a.m. Saturday.

Gonzalez grabbed a pillar and narrowly avoided falling from the platform onto the tracks, police sources said.

A cop heard screaming on the platform, and was told by a witness that Keeley intentionally pushed her victim toward the tracks as a train was pulling in, according to the sources.

Gonzalez explained to cops that she didn’t see Keeley move toward her, but felt a push and quickly grabbed a pillar so she wouldn’t fall in front of the northbound train, according to sources.

She suffered a bruise on her right elbow and wrist, as well as back pain after the push, sources said.

The actress was arrested at the station, and initially claimed she’d simply bumped into Gonzalez, with whom she’d had no prior interaction — and even tried to grab her before she fell.

Keeley later told police she’d been out boozing with her boyfriend, Jeff, at the 12th Street Ale House in the East Village, where she threw back four glasses of wine before heading home to the Bronx, according to sources.

She admitted feeling “wiggly” and buzzed while waiting in the subway station, but denied pushing Gonzalez, sources said.

Keeley, who has no prior arrests, was charged with attempted assault with intent to injure with a weapon. Her bail was set at $7,500, which she posted Monday, records show.

Police sources said the incident was not caught on camera, but cops were planning to interview the train operator.

Keeley has performed in off-Broadway productions, including “The Glass Menagerie” in 2010 and “Angels in America: Parts 1 & 2” in 2011, according to her website.

“And the pellucid, trembling Keeley . . . is almost unbearably effective as a girl destined to have her heart crushed as surely as her glass unicorn figurine will be broken,” Time Out New York wrote of her “Glass Menagerie” performance.

She’s also made appearances in TV shows like “Elementary,” “Rubicon” and “The Path.”

Neighbor Freddie Santos, 18, said he saw her about a week ago “playing her guitar” for a couple of little kids in her Bronx building.

A woman who answered the door to Keeley’s apartment, where she lives alone, said the actress “is not here.”

Additional reporting by Larry Celona and Danika Fears