"Castle" and "Five Little Pigs"

Have any of you seen the recent "Castle" TV episode "Like Father, Like Daughter?" It's about Castle and his daughter trying to save a man scheduled to be executed in three days. (MINOR SPOILERS) There are distinct parallels between the condemned man and Caroline Crale in "Five Little Pigs." I wonder if the screenwriter read the book and was influenced by it?
Comments
Its more similar to Mrs Mcginty's Dead