Cousins in the Castle by Barbara Brooks Wallace, 1996.
Young Amelia Fairwick is living a happy life in London with her father and her father’s fiancée, Felicia, when her father leaves on a business trip and word reaches her that he has been killed in a hotel fire. Now, the poor orphaned girl must go live with her deceased mother’s cousins in New York. Amelia leaves behind everything that is familiar to her when she accompanies her stern and gloomy Cousin Charlotte on the ship to New York.
On the ship, she makes only one friend, a young actress and singer named Primrose Lagoon, whom Cousin Charlotte forbids her to see. Although the future looks gloomy for Amelia, there are far stranger and more sinister events in store for her. As soon as they reach New York, Cousin Charlotte abandons Amelia on the docks. A kind woman named Nanny Dobbins and her son offer help her, only to steal her luggage and make her a prisoner in a small cellar in a bad part of town.
When her jailer, the drunken Mrs. Shrike, falls asleep, leaving the door open, Amelia escapes and attempts to find Primrose, her only friend in the city. Throughout Amelia’s adventures, she doesn’t know who to trust, and every step she takes seems to bring her closer to the mysterious Cousin Basil, who is supposed to be her guardian, and his castle-like home.
The time period for this story is never exactly defined, but it appears to take place during the 1800s because of the gaslights in use. Like many of Wallace’s books, things and people are not what they seem, but in spite of the villain’s sinister intentions, it all ends happily.