SAN JOSE -- San Jose State quarterback David Fales gave Wyoming a taste of what it is missing.

The senior threw for 482 yards and five touchdowns, and his 1-yard sneak with eight seconds left was the winning touchdown in a 51-44 victory over the Cowboys in front of 16,123 fans at Spartan Stadium on Saturday.

Fales, a former walk-on at Wyoming whose dad lives in the state, tried to play down any additional satisfaction he felt in beating the school that declined to offer him a scholarship. But he clearly enjoyed the victory.

"In the back (of my mind), yeah, a little bit," Fales said of any extra emotions. "But it's not personal. I can't make it about me. I've got my dad calling me, and he's got a whole group in Wyoming, so it's definitely exciting and fun, but that's not what it's about."

The passing yardage and five passing touchdowns were career highs for Fales, and the winning score was his first career rushing touchdown. He set a Mountain West Conference record with his fifth consecutive 300-yard passing game.

"David had a heck of a night, maybe one of his all-time best as a Spartan," coach Ron Caragher said.

Was this his best game?

"I don't know," said Fales, who completed 27 of 37 passes. "I'm just doing the same stuff. We've got a lot of guys making plays."

Freshman Jarrod Lawson had his first career 100-yard game with 128 rushing yards on 25 carries. Tyler Winston had career highs of nine catches for 171 yards, becoming the first SJSU freshman with three consecutive 100-yard receiving games.

Chandler Jones caught four passes for 129 yards and matched a school record he already shares with three touchdowns. Freshman tight end Billy Freeman had career highs of six catches for 119 yards and contributed to the play of the game.

With the score tied at 44 with 1:46 left, San Jose State (4-3, 3-1) had the ball at the Wyoming 46-yard line on fourth-and-1. Fales appeared to convert a quarterback sneak, but the Cowboys (4-4, 2-2) called a timeout just before the snap.

The Spartans went for it again, and Fales hit Freeman on a play-action pass for 33 yards to help set up the winning score.

It was redemption for Freeman after he dropped a wide-open pass in the first quarter.

"I knew I needed to get it for the team," Freeman said.

Fales had full confidence in the play.

"Right when we lined up, I knew we were going to get it," Fales said. "Play-action, everybody bit. The corner, backer and the safety, so he was wide open."

It was the third consecutive victory for San Jose State, all comebacks. The Spartans can move a step closer toward bowl eligibility next week when they face UNLV (5-2, 3-1), which is tied for second in the West Division with SJSU.

At several points, it looked as if the Spartans were poised to deal with a disappointing home defeat. Wyoming surged to a 16-0 lead in the first quarter. After the Spartans pulled within nine by halftime, the Cowboys scored just 24 seconds into the third quarter to lead 30-14.

"We came out and looked like a team that was flat and didn't execute. Just very frustrating early on," Caragher said.

But Fales heated up in the third quarter, and he had help. He hit Winston for a 60-yard touchdown, Tim Crawley got his first career touchdown on a 9-yard run, then Fales found fullback Shane Smith for a 3-yard scoring pass. The 22 unanswered points gave the Spartans a 36-30 lead.

The lead flipped two more times before it was tied at 44 when Wyoming scored with 5:17 left.

That's when the Spartans won the game with a time-consuming drive that included the big fourth-down play to Freeman. Thomas Tucker, making his return from a scary concussion two weeks ago, added a big third-down run to reach the 2 and help run the clock down ahead of Fales' score.

Follow Jimmy Durkin on Twitter at Twitter.com/Jimmy_Durkin.