A frame of simulated star map needs to superimpose various types of background noise on it, among which the omissive refractive stray sunlight out of the sun baffle is one of the most important noise sources. For the real time simulation of star maps, the optimal scheme should be that sun stray light noise generation relies on mathematical model rather than the pre-generated noise frame base to be loaded. Firstly the formation mechanism of sun stray light noise out of star tracker baffle is introduced and its modeling method is given, the sun directional vector at the imaging time is converted to the unit vector coordinates in the star tracker body frame through a series of attitude transfer matrix, and continue to be projected on the extended imaging plane via the optics model, gray value of each pixel is assigned based on the distance between the sun projection point and the corresponding pixel. Then, based on a set of sun simulator experimental imaging data in different angles for the performance test of a certain baffle, the model coefficients are estimated through fitting method. Finally, the item of sun stray light noise simulated this way is superimposed on the basic pure simulated star map, so the similarity of the final outputted star map is further promoted in the electronic star simulator used in a certain institution. The scenarios simulated by this method, which depict the circumstance that the boresight of the star tracker is adjacent to sun vector, are convenient tools for the robustness test of star image centroiding algorithm or on-orbit real time flight simulation involving star light attitude determination.