Lia got by leader David Starr in the second turn of the 250th lap around the 0.5-mile oval. He, Starr and 2006 series champion Todd Bodine ran side-by-side down the backstretch before Lia pulled his Chevrolet ahead to edge Starr by 0.241 seconds for his first victory in his eighth series start.
Starr, who had his Toyota in front since the 80th lap, was bidding to end a 52-race winless streak that dates to 2006.
Lia, NASCAR's 2007 Whelen Modified Tour champion, became the first rookie to win on the circuit since August 2003, when current NASCAR Sprint Cup Series competitor Carl Edwards won in Nashville.
"I used everything I had there at the end and I couldn't have driven it any harder," said Lia, who started 28th -- farthest back of any Mansfield winner. "We just got them on the restarts and got them where we had to get them. We just did everything right today, my crew (and) everybody."
The 27-year-old from Jericho, N.Y., averaged 62.517 mph for the 250-lap, 125-mile race. He became the 10th driver -- and first since 2006 -- to lead only the final lap of the race. Seven drivers exchanged the lead six times as 15 caution periods consumed 80 laps.
Lia won $45,500 from $513,636 in posted awards.
Terry Cook finished fourth behind Starr and Bodine with Mike Skinner taking fifth. Shelby Howard, Jack Sprague, Johnny Benson, Sean Murphy and Stacy Compton completed the top 10.
All but two drivers in the 36-truck field finished the race -- 29 of them on the lead lap.
Bodine assumed the championship lead by eight points over Rick Crawford as previous leader Ron Hornaday Jr. was involved in an accident on lap 47 and spent most of the race behind pit wall as his crew repaired his Chevrolet. The defending series champion was credited with a 35th-place finish, 105 laps behind the winner.
Pole starter Benson led the race's first 45 laps before being passed by Hornaday, whose advantage lasted less than two circuits before a mishap in the fourth turn. Skinner, Howard and Dennis Setzer led during the next 33 laps before Starr -- who'd pitted for fuel early -- cycled back to the front and remained there through multiple restarts.
Bodine made several attempts to pass Starr on several late restarts following cautions, but was unable to make the challenges stick. Lia, who ran as far back as 23rd after making his only fuel stop on lap 38, fought his way into the top five on lap 196, took third on lap 210 and dispatched Bodine's Toyota at lap 228.
The event's final caution, for Brendan Gaughan's spin in the second turn, proved to be pivotal as it erased Starr's five truck-length lead and set up the final-lap dramatics.
"It was just good short-track racing," Starr said. "I guess I left a hole open and he got into me in the left rear. We just drove into Turn 3 on a prayer. (Lia) had the preferred line."
Helm helps Red Wings take 2-0 series lead
Crunch drop Marlies again, take 2-0 series lead home
Trucks: Crafton survives wild finish for first win