Ridgefield edges Staples, 24-20, on late TD pass