Carry Trade/Borrowing

If we buy a 5 year bond yielding 5%, & borrow at the 6-month rate for 1%, we can make the 4% spread. But let’s say we want to buy a 5 year bond yielding 5%, and short the 2 year bond yielding 2% let’s say. If we only want to do this trade for 6-months, is this still a carry trade? And how do we ‘end it’ after 6 months if we shorted a 2 year bond. Do we just buy the bond in the market & return it to the lender just like with shorting a stock?