The Railwaymen's four-year stay in League One was ended last week but they went ahead when Oliver Turton's 25-yard shot dipped over goalkeeper Joe Anyon.
Williams lashed in a right-footed effort to equalise before Hakeeb Adelakun turned in a cross for 2-1.
It was 3-1 when Williams bundled the ball in from close range meaning Marcus Haber's flick was just a consolation.
Crewe boss Steve Davis, whose side have not won since 6 February, was targeted by angry home fans throughout as they look set to finish the season rock-bottom, while Scunthorpe dropped to 10th.
Relegated Crewe slumped to a seventh successive loss as Luke Williams' brace helped Scunthorpe to victory.