Preheat oven to 350°F (175°C). Line two cupcake tins with paper liners.
In a stand mixer, beat butter, vanilla extract, lemon extract, sugar, and lemon zest until light and fluffy (about 2 minutes).
Add eggs one at a time, mixing well after each addition.
Mix in sour cream, then milk, on low speed.
Add 3 ¼ cups cake flour, baking powder, baking soda, and salt. Gently fold until just combined. Do not overmix.
Toss raspberries with remaining 3 tablespoons flour. Fold gently into batter.
Fill liners ¾ full.
Bake one pan at a time for about 22 minutes, until a tester comes out clean or with a few moist crumbs.
Cool in pan 10 minutes, then transfer to wire rack. Cool completely before frosting.