VANCOUVER -- Sergio Castillo hit his third field goal of the night from 50 yards out with 10 seconds left in the fourth quarter as the Hamilton Tiger-Cats defeated the B.C. Lions 24-23 on Friday.

Jeremiah Masoli threw touchdowns to Brandon Banks and Luke Tasker for Hamilton (3-9).

Alex Green rushed 13 times for 140 yards in his CFL debut for the Tiger-Cats.

Jonathon Jennings ran in the only touchdown for B.C. (6-7), while Ty Long hit five field goals.

After the Lions went ahead on Long's fifth field goal of the night, the Tiger-Cats got the ball back at their own 26 with 1:48 to play, and drove it all the way to B.C.'s 42 before Castillo hit the winning points.

B.C. entered play last in the CFL's ultra-competitive West Division, and in serious danger of missing the playoffs for the first time since 1996, while Hamilton still has life in the soft East.

The Tiger-Cats led 18-17 after three quarters, and went up by four when Castillo hit a 22-yard field goal to cap a 10-play drive that chewed up more than six minutes.

The Lions responded with a 45-yard Long field goal to make it 21-20 with under seven minutes to go, and their defence forced a two-and-out with a sack of Masoli on second down.

Jennings then found Bryan Burnham for a 24-yard completion before Jeremiah Johnson scampered for 19 more to Hamilton's 17, but the drive again stalled as Long gave his team a 23-21 lead.

Tied 11-11 after at the half, Long put the Lions ahead just over five minutes into the third quarter when he connected on a field goal from 38 yards, but Masoli connected with Tasker on a 15-yard touchdown on Hamilton's next drive to make it 18-14.

The Lions drove the ball down to the Tiger-Cats' three thanks to a 48-yard completion from Jennings to Shaquille Johnson, but the next two passes fell incomplete as B.C. had to again settle for a short field goal.

Jennings hurt his throwing shoulder on B.C.'s first play from scrimmage in Hamilton back on July 15 -- a game the Lions went onto win 41-26 with backup Travis Lulay at the helm.

Jennings wasn't the same player when returned to the lineup after a month out and was benched after 2 1/2 games in favour of Lulay. But the 25-year-old was back under centre two weeks ago after Lulay suffered a torn anterior cruciate ligament in his right knee, ruling him out for the rest of the season.

Jennings led B.C. past the Montreal Alouettes that night, but the offence was completely out of sorts in last week's 27-13 road loss against the Calgary Stampeders as the Lions failed to score a touchdown.

The Tiger-Cats, meanwhile, were coming off a 27-19 home defeat to the Saskatchewan Roughriders following back-to-back wins -- their first two victories of the season -- with June Jones in charge after vice-president of football operations Kent Austin fired himself as head coach.

The visitors jumped out to a 7-0 lead in the first quarter Friday on a nice throw from Masoli to Banks for a 19-yard touchdown.

The Tiger-Cats followed that up with some trickery, but B.C. recovered the ensuing onside kick to set the Lions' offence up at Hamilton's 52.

Jennings led a methodical nine-play drive that culminated in his two-yard touchdown run before finding Burnham in the corner of the end zone for the two-point conversion and an 8-7 lead.

Hamilton drove the ball back into B.C. territory, but Castillo's 47-yard field-goal attempt struck the right upright and fell harmlessly to the turf.

Castillo added a single on another missed field goal, this time from 42 yards, with seven minutes gone in the second quarter to tie the score 8-8 after Tiger-Cats defensive back Richard Leonard stripped Johnson and recovered the fumble near midfield.

Long restored B.C.'s lead with a 16-yard boot with under three minutes to go in the half, but Castillo made amends for his two misses with a 53-yarder with one second left on the clock to knot the score 11-11.

The Lions now head into their second bye week of the season, and second in a month, before returning to action at home against the Ottawa Redblacks on Oct. 7. The Tiger-Cats host the Toronto Argonauts next Saturday.