The heartwood of Dalbergia odorifera T. Chen (D. odorifera) is esteemed for its high flavonoid content. This study aimed to explore the spatial distribution of heartwood components in the xylem, analyze their accumulation patterns, and further discuss the synthesis and migration pathways of these components. To achieve this, DESI-MSI technology was employed, leveraging the specific interaction between flavonoids and the naturally derived compound Naturstoff A (diphenylboronic acid 2-aminoethyl ester), alongside Raman microscopy techniques to elucidate the in situ distribution of heartwood extracts in the xylem. Additionally, combined with microscopic observations of the pits, the study investigated the accumulation and migration pathways of heartwood components in D. odorifera. The findings indicated that the total flavonoid content increased from sapwood to heartwood and subsequently decreased, with the difference in fluorescence intensity before and after extraction displaying a similar trend. The distribution pattern of various flavonoids in the xylem was as follows: heartwood > transition zone > sapwood, and this distribution was uneven among different tissues within the same region. Notably, within the same region, the flavonoid accumulation in axial parenchyma cells was greater than that in ray parenchyma cells. Moreover, the cell corners were identified as the main sites of deposition for heartwood extracts. This research underscores the distribution patterns of heartwood constituents within the xylem, providing a scientific foundation for the conservation, enhancement, and utilization of D. odorifera heartwood resources.