Pentamethine dyes are often used for near infrared fluorescent probes owing to the advantage of high sensitivity, however, their photostability is not so satisfying. In this paper, a series of pentamethine dyes which contain electron-donating groups like amino or hydroxyl groups were synthesized, and the effect of substituents on photostability and the application in cell imaging were also discussed. The results indicated that the photostability of fluorescent dyes which possess electron donors of amino and hydroxyl groups was high, and the lifetime of excited state of fluorescent probes were reduced after leading into the amino group proved by femtosecond transient absorption, respectively. Photostability is negatively correlated with the lifetime of the excited state and the fluorescent dyes are mainly localized in mitochondria of living cells. This research will be of importance for designing cyanine dyes with high photostability and good cellular stain properties.