Contrary to the statement in your question: Compared to the sun, the halogen lamp will appear more yellow. (But please don't look directly at the sun. It will harm your eyes.)
Since blue light is dispersed by the atmosphere, the sun will appear increasingly yellow, the more atmosphere the sunrays have to pass through. But I kinda doubt midday sun will have any problem "out-bluing" the halogen lamp.
It may even be that the 5000k color temp of the sun, actually refers to midday sun, and that the sun itself (without atmosphere) is actually even "bluer". I don't know that. But I would suspect so, since the 5000K figure is used as a reference to balance colors correctly in photography and film.
The sun is classed as a "yellow" sun. It's an astronomical classification. That doesn't mean it's yellow at all. The sun is, in physical sense,
white. Which actually means that the light contains radiation from the entire spectrum. A candle light is also "white". As are all lightsources that emits light from heat. If you compare such white lightsources side by side, one may appear yellow, another blue. That is because the energy is differently weighted in the spectrum. Our brain seeks some 'ambient' color temperture for reference, in order to judge colors. (Amazing trick actually, that lets us correctly recognize a color, even if it's reflected spectrum fluctuates wildly, in different lighting.)
So, the sun appears yellow, is because it's more "yellow" than the ambient whitepoint, which is also contributed to by the light from the blue sky. Which in turn is actually blue light that the sun has shed.
Similarily, the halogen light appears blue, indoors, because it's bluer than the ambient whitepoint, which largely comes from "yellow" artificial light.
Experiment of truth: If you illuminate an object with the halogen lamp, and take a picture with a camera, no flash please. The developed picture will turn out quite yellowish. That is because you have daylight film in the camera. The film expects the much bluer light from the sun. Your halogen lamp is "yellow" in comparision.
The reverse is also possible. One used to be able to buy film for 4200K, I think. If you take outside pictures with this, they will come out rather blue. Proving of course that the sun really is bluer than your 4175K halogen lamp.
Film doesn't have any brain, that compensates for the type of illumination. But photo printing machines have, ...sort of.
For this to work, you need to use diapositive film. Negative color film will not give such obvious results. In the printing process, the colors are automatically "balanced" by the printer. (That's why prints so often turn out crappy, BTW

)
Final words of this, don't get color temperature and color mixed up. The sun's
color is
white. Nothing else. Same as a light bulb.