In today's Washington Post, Dennis Drabelle quotes from John Sutherland's Curiosities of Literature, stating that "the first female detective in literature was probably Amelia Butterworth, who made her debut in Anna Katharine Green's That Affair Next Door (1897)."
The assertion is inaccurate. Mrs. G. in The Female Detective (1864) by Andrew J. Forrester Jr. is commonly identified as the first female detective in fiction. Also predating Butterworth are Mrs. Paschal in the anonymous The Experiences of a Lady Detective (1864, following Forrester by six months; attrib. to William Stephens Hayward, but there is controversy about this attribution), Catherine Louisa Pirkis's Loveday Brooke (1893, stories collected in The Experiences of Loveday Brooke, Lady Detective), and Emma Van Deventer's Madeline Payne (Madeline Payne, Detective's Daughter, 1884; and Moina, 1891). One could also argue that Wilkie Collins's Marian Halcombe acts as a detective in The Woman in White (1860), as well as Mary Elizabeth Braddon's Eleanor Vane in Eleanor's Victory (1863).
Update. The Female Detective and The Experiences of a Lady Detective have been reprinted in The First Female Detectives (2010). In addition, The Female Detective and Experiences of a Lady Detective (under its alternate title, Revelations of a Lady Detective) have been reprinted by the British Library (distrib. U of Chicago P).