Nutty squirrels are going off the rails on the city’s subways.

In the second such incident in two weeks, a squirrel accosted a train driver Thursday after running through a window of a Coney Island-bound Q train north of the Cortelyou Road station at about 9:20 a.m., according to transit sources.

After the motorwoman hit the brakes, riders helped her chase the squirrel out. It was unclear if it was at the next station or between subway cars.

Last week, a train operator was sent to the hospital when a squirrel attacked her on the stairs at a Bronx subway station and chomped on her middle finger.

The 24-year transit veteran was bitten at the Woodlawn station in the Norwood section of the borough.

She was treated at Jacobi Hospital for the wound.