HOUSTON — Matt Hasselbeck and Andre Johnson showed Thursday night that sometimes old guys can shine in what is certainly a young man’s league.

The 34-year-old Johnson caught two touchdown passes from the 40-year-old Hasselbeck, the second for 2 yards in the fourth quarter, to help the Colts beat the Texans 27-20.

“You get over the age of 30 they kind of count you out,” Johnson said. “But we proved to people that we could still play.”

Released by Houston in March after 12 seasons with the team, Johnson had six catches for 77 yards.

The Colts (3-2) extended their AFC South winning streak to an NFL-record 16 games.

Hasselbeck was filling in for Andrew Luck, who missed his second straight game with a shoulder injury.

Hasselbeck’s performance was even more impressive given the fact that he was battling a bacterial infection that hospitalized him this week. He started feeling ill just before halftime Sunday in a victory over Jacksonville and didn’t start feeling better until Thursday night.

“I honestly feel like this isn’t even real right now,” Hasselbeck said.

Coach Chuck Pagano raved about Hasselbeck.

“He was literally on his deathbed Monday/Tuesday and mustered up enough to come in Wednesday and practice,” Pagano said. “He was getting IVs and fighting a virus and the grittiest performance I’ve seen in a long, long time.”

Brian Hoyer, who replaced Ryan Mallett for Houston (1-4) in the second quarter, threw a pass up for grabs that was intercepted by Mike Adams with less than 2 minutes left.

Johnson extended the lead to 27-17 with the 2-yard reception with about 10¹/₂ minutes left. The Texans intercepted Hasselbeck’s pass in the end zone earlier in that drive, but the play was negated because of defensive holding on Eddie Pleasant. A second penalty, this one for pass interference gave the Colts a first down at the 1.

Mallett got the wind knocked out of him on an illegal hit midway through the second quarter and was replaced by Hoyer. Mallett looked to be OK soon after that, but coach Bill O’Brien stuck with Hoyer. He finished with 312 yards passing with two touchdowns.

Both of the touchdowns were to rookie Jaelen Strong and they came on his first two NFL receptions.

DeAndre Hopkins had 11 receptions for 169 yards for Houston.

“We’re not happy obviously,” J.J. Watt said. “But we’re going to go back to work and figure it out.”

Foster, who was shaken up in the second quarter but returned after halftime, had 44 yards rushing and 77 yards receiving in his second game back after groin surgery.

The Colts opened the second half with a drive capped by Frank Gore’s 3-yard touchdown that made it 20-10. Gore finished with 98 yards rushing.

Strong’s second catch and touchdown came on an 11-yard pass by Hoyer to get Houston to 20-17 in the third quarter.

Hoyer’s desperation throw on the last play of the first half that Strong pulled down in a sea of Indianapolis defenders for a 42-yard touchdown strike that cut the lead to 13-10. Strong boxed out two defenders and outjumped the others to reel in his first NFL catch.

Johnson entered the game without a catch in the last two games after having just one such game in his entire career in Houston. The Colts made sure that wouldn’t happen again Thursday night, going to him early. He drew boos from the home crowd when he grabbed a 23-yard reception late in the first quarter. Two plays later, he scored his first touchdown of the season when he was wide open in the back of the end zone for 4-yard reception that made it 10-0.

“When I would be on the sidelines a lot of the fans were screaming, ‘Andre we still love you! Come back to Houston! Welcome home!’” Johnson said. “So that was probably the most special thing.”

Mallett was shaken up when Sio Moore received a penalty for roughing the passer when he crashed his helmet into the quarterback’s chest with about seven minutes left in the second quarter. Mallett appeared to struggle to catch his breath and was replaced by Brian Hoyer. He was tended to by trainers for a couple of minutes after leaving the game, but soon put his helmet back on and stood near coach O’Brien.

Hoyer finally got Houston’s offense going and the Texans cut it to 13-3 on Nick Novak’s 36-yard field goal.

Mallett looked good early, helping the Texans into the red zone. But then Foster deflected a pass and Adams intercepted it. The Colts took a 3-0 lead with a 48-yard field goal on the ensuing drive.