HOUSTON — Saturday’s dramatic 6-4 loss in Game 6 of the ALCS didn’t just end the Yankees’ season, it could have ended Didi Gregorius’ and Brett Gardner’s time with the team.

Both veteran players will head to free agency with uncertain futures and they’ll head to the market coming off different seasons, with Gardner having had a bounce-back year and Gregorius struggling after returning from offseason Tommy John surgery.

Gardner, 36, said he “of course” wants to play next season and has been through this before — including last year, when his future was unclear.

“I haven’t really thought about it yet,” Gardner said. “In the next few weeks, we’ll talk about that.”

Gregorius, who turns 30 in February, will be a free agent for the first time and admitted he’s unsure of where he’ll wind up.

“That’s not my department,’’ Gregorius said of how the Yankees might look in 2020. “I don’t even know where I’m gonna be, so that’s the thing. Who knows what gonna happen?”

Asked if he wants to stay in The Bronx, Gregorius said, “Yes.”

And he lamented how 2019 ended, with Jose Altuve hitting a game-winning homer in the bottom of the ninth to send the Astros to the World Series.

“It’s not a successful season because we’re not just playing to get [103] wins,’’ Gregorius said of the team’s regular season success. “We want to play to get to the World Series and win. That’s what we played the whole year for.’’

As for Gardner, he struggled through much of the playoffs, but nearly made up for it Saturday.

Down by two runs in the top of the fourth, Gio Urshela got the Yankees to within a run with his one-out homer off Jose Urquidy. Gardner then came to the plate and drilled a shot deep down the right field line that just curved foul.

Gardner followed the near miss with an opposite field single to left and DJ LeMahieu followed with a long fly ball to center, but George Springer tracked it down.

And with the Yankees still down a run in the sixth, they got a walk from Gary Sanchez and a flare single to center by Urshela. Gardner then lined a shot to right, again off Urquidy.

Josh Reddick approached the ball and made an uncomfortable-looking dive and made an outstanding catch for the second out. Reddick’s play paid off, but if it got by him, the Yankees almost certainly would have taken their first lead of the game.

Instead, with two out, Houston manager A.J. Hinch pulled Urquidy for Will Harris, who got LeMahieu to ground out, ending yet another scoring opportunity for the Yankees.

It was part of an overall rough night for Gardner — and the Yankees.