Ryan Longwell made a field goal with nine seconds left to give Minnesota a comeback win over Detroit.