If it’s sticking down from the ceiling in the basement I would suspect its venting something on the first floor. I would figure out where that point is on the first floor and go up there and take a look. Maybe a bathroom or kitchen is above that location. If the pipe is located in a wall it gets a little trickier but I doubt a plumber running vents in a wall would opt to go down and just stop there. Clearly smell is coming out it so it is connected to a live line.
We could guess as to what’s above, but the OP can take a look and let us know easier. Capping it off might work or it might seem to work until someone runs a sink or two and flushes a toilet all at once and then a trap will get sucked dry and there will be a new location for a smell. There are a many things it could be maybe someone installed a cheater vent and ran the air inlet down and now the cheater is stuck. We just don’t know the facts beyond it’s an open pipe and sewer gas is coming out of it.