<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-09-09</periodOfReport>

    <issuer>
        <issuerCik>0001707753</issuerCik>
        <issuerName>Elastic N.V.</issuerName>
        <issuerTradingSymbol>ESTC</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0002003569</rptOwnerCik>
            <rptOwnerName>Dodds Mark Eugene</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O ELASTIC N.V.</rptOwnerStreet1>
            <rptOwnerStreet2>88 KEARNY STREET, FLOOR 19</rptOwnerStreet2>
            <rptOwnerCity>SAN FRANCISCO</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>94108</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>Chief Revenue Officer</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Ordinary Shares</value>
            </securityTitle>
            <transactionDate>
                <value>2025-09-09</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>5037</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>90.12</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>167284</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">The ordinary shares were sold to satisfy the Reporting Person's tax obligations in connection with the vesting of performance-based restricted stock units and restricted stock units. The sales were mandated by the Issuer's equity incentive plan which requires the satisfaction of tax withholding obligations to be funded by a &quot;sell to cover&quot; transaction and does not represent a discretionary trade by the Reporting Person.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Marielle Reints, by power of attorney</signatureName>
        <signatureDate>2025-09-10</signatureDate>
    </ownerSignature>
</ownershipDocument>
