Neville drew the sword from the sorting hat like Harry did in his second year in his fight against the basilisk. He was able to do this because he had shown bravery in standing up to Tom Riddle, Lord Voldemort, and proved himself to be a true Gryffindor and was therefore able to get the sword when he needed it. like Dumbledore said in Harry's second year " ... help will always be given at Hogwarts to those who ask for it."
Godric Gryffindor had bewitched the Sword of Gryffindor centuries before to come to any faithful Gryffindor in need of it. In that sense, Rufus Scrimgeour had been correct that Dumbledore could not will the sword to Harry.